auth parameter in the createPiece, createTrigger, and createAction functions.
This requirement ensures that the type of authentication can be inferred correctly in triggers and actions.
Secret Text
This authentication collects sensitive information, such as passwords or API keys. It is displayed as a masked input field. Example:Username and Password
This authentication collects a username and password as separate fields. Example:Custom
This authentication allows for custom authentication by collecting specific properties, such as a base URL and access token. Example:Token Refresh (Server-Side Caching)
Some APIs require a login call to exchange credentials for a short-lived token. Without caching, this login happens before every action and can trigger 429 rate limit errors from the third-party API. Add an optionalrefresh callback to have Activepieces fetch the token once, cache it server-side, and inject it into every action/trigger as context.auth.access_token. The token is automatically renewed up to 15 minutes before it expires (clamped to half the token lifetime for short-lived tokens).
Example:
context.auth.access_token:
refresh is opt-in. Pieces that don’t define it are unaffected. The generate callback receives the same flat auth object as validate (i.e. auth.baseUrl, auth.username), not the connection value wrapper.OAuth2
This authentication collects OAuth2 authentication details, including the authentication URL, token URL, and scope. Example:Connection Identifier
Every auth type (SecretText, BasicAuth, OAuth2, CustomAuth) accepts an optional getConnectionIdentifier callback. It resolves a human-readable label for a connection (e.g. the account email, or Slack’s “display-name (workspace)”), shown in the UI so users can tell which account a connection belongs to.
Example:
This is best-effort: it must never throw, and returning
undefined is fine when no identifier can be resolved. For OAuth2 connections, Activepieces already derives an identifier from the token response’s OIDC claims when present. Only add getConnectionIdentifier when the provider needs custom handling (e.g. Slack’s workspace + user lookup).