> For the complete documentation index, see [llms.txt](https://docs.baas.sh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.baas.sh/baas-console/action-plugins.md).

# Action Plugins

Activate and configure the project-wide engines behind automation actions, including the SMTP transport, Firebase credentials, and per-plugin defaults.

Each type of [automation action](/baas-console/automations/actions.md) runs on a plugin, configured here. A plugin holds the SMTP server your emails leave through, the Firebase credentials behind your pushes, and the defaults for API calls and functions.

Open **Action Plugins** from the sidebar's **Settings** group. The page shows one tab per plugin: **API**, **Email**, **Function**, **Notification**, and **Transaction**. Each tab holds a **Config (JSON)** editor, prefilled with a starter template before the first save, a **Save** button to persist it, an **Active** toggle, a **Configured** badge, and a **Setup guide** panel with the plugin's pre-production checklist.

Anything specific to a single action, like a recipient or a URL, stays on the action itself.

{% hint style="info" %}
**Configuration is project-wide.** Every action of a type shares its plugin's settings; changing them here changes future runs of every automation that uses the type.
{% endhint %}

## Ready out of the box or needs setup

| Plugin           | Out of the box                         | To do                                        |
| ---------------- | -------------------------------------- | -------------------------------------------- |
| **API**          | Active, with built-in request defaults | Nothing                                      |
| **Function**     | Active, with built-in runtime defaults | Nothing                                      |
| **Transaction**  | Active, no settings at all             | Nothing                                      |
| **Email**        | Inactive                               | Save the SMTP transport, then activate       |
| **Notification** | Inactive                               | Save the Firebase credentials, then activate |

The **Configured** badge marks a plugin you can activate.

## Activate and deactivate

* Configuration comes first: **Save** a valid config, then flip **Active**.
* **Save** and the toggle are independent: saving leaves activation as it is, and activating uses the configuration you last saved.
* Switching a configured plugin off locks its configuration, so turn it back on to make changes.
* Activating a plugin unlocks saving new actions of its type in automations.
* You can deactivate a plugin once no automation action uses it, and the Console shows you which ones still do.

## Email

The Email plugin sends through your own SMTP server. Its configuration holds the transport, plus optional sender defaults:

```json
{
  "transport": {
    "host": "smtp.example.com",
    "port": 465,
    "secure": true,
    "auth": { "user": "username", "pass": "password" }
  },
  "from": "Console Alerts <alerts@example.com>",
  "replyTo": "support@example.com"
}
```

Set `secure` to match the port, following the SMTP convention: `true` with `465`, `false` with `587` or `25`. **Save** rejects mismatched pairs.

`from` is the sender used whenever an [Email action](/baas-console/automations/actions/email.md) leaves its From field empty.

## Notification

The Notification plugin delivers through Firebase Cloud Messaging, using your own Firebase project's credentials.

### Set up Firebase credentials

{% stepper %}
{% step %}
In Firebase, open **Project settings → Service accounts** and click **Generate new private key**. Firebase's [Admin SDK setup](https://firebase.google.com/docs/admin/setup) covers it.
{% endstep %}

{% step %}
In the **Config (JSON)** editor, set `credentialMode` to `service_account`.
{% endstep %}

{% step %}
Copy the key's values into a `serviceAccount` object, renaming them to camelCase: `project_id` → `projectId`, `client_email` → `clientEmail`, `private_key` → `privateKey`.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
**The template starts in `application_default` mode.** For this setup, change it to `service_account`.
{% endhint %}

```json
{
  "credentialMode": "service_account",
  "serviceAccount": {
    "projectId": "my-app",
    "clientEmail": "firebase-adminsdk-...@my-app.iam.gserviceaccount.com",
    "privateKey": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
  },
  "maxBatchSize": 100,
  "defaultTtlSeconds": 3600,
  "androidPriority": "high",
  "androidChannelId": "alerts",
  "apnsSound": "default"
}
```

The service account is a secret: it stays here, server-side, and never ships in your app.

{% hint style="warning" %}
**Use the same Firebase project on both sides.** The web config in your app and the service account here must come from the same project, or delivery fails with `messaging/mismatched-credential`.
{% endhint %}

The delivery settings ride along in the same object:

| Setting             | Template value | What it does                                                    |
| ------------------- | -------------- | --------------------------------------------------------------- |
| `maxBatchSize`      | `100`          | Tokens sent per FCM call; longer lists are split                |
| `defaultTtlSeconds` | `3600`         | How long a push waits for an offline Android device, in seconds |
| `androidPriority`   | `high`         | Delivery priority on Android                                    |
| `androidChannelId`  | `alerts`       | Notification channel on Android                                 |
| `apnsSound`         | `default`      | Notification sound on iOS                                       |

Once the plugin is active, the [Notification action](/baas-console/automations/actions/notification.md) does the sending, and the [Push notifications](/baas-sdk/integrations/push-notifications.md) guide shows how your app registers the devices on the receiving end.

## API defaults

The API plugin runs on built-in defaults, adjustable here:

| Setting                 | Default                                | What it does                               |
| ----------------------- | -------------------------------------- | ------------------------------------------ |
| `defaultHeaders`        | `{"Content-Type": "application/json"}` | Headers added to every request             |
| `defaultTimeoutSeconds` | `15`                                   | Timeout when the action sets none          |
| `userAgent`             | `BaaS Console API/1.0`                 | User-Agent when your headers don't set one |
| `followRedirects`       | `false`                                | Whether redirects are followed             |
| `maxRedirects`          | `5`                                    | Redirect cap when enabled                  |
| `maxResponseBytes`      | `65536`                                | Response size cap (64 KiB)                 |

An [API action](/baas-console/automations/actions/api.md) can override these: its Timeout replaces `defaultTimeoutSeconds`, and its Headers merge over `defaultHeaders`, key by key.

## Function defaults

The Function plugin's runtime defaults:

| Setting            | Default | What it does                             |
| ------------------ | ------- | ---------------------------------------- |
| `defaultTimeoutMs` | `30000` | Timeout when the action sets none        |
| `maxResultBytes`   | `16384` | Cap on a function's return size (16 KiB) |

A [Function action](/baas-console/automations/actions/function.md) can override the default: its Timeout replaces `defaultTimeoutMs`.

{% hint style="info" %}
**The 64 KiB chain cap still applies.** Raising `maxResponseBytes` or `maxResultBytes` lets a step read or return more, but a result over 64 KiB reaches the next step as `null`. See [Context object](/baas-console/automations/reference/context.md).
{% endhint %}

## Next

* [Email action](/baas-console/automations/actions/email.md): send your first email from an automation.
* [Notification action](/baas-console/automations/actions/notification.md): send your first push from an automation.
