I just launched Social SDK. Come check it out →
Email SDK
PluginsBuilt-in plugins

Defaults plugin

Apply reply-to, headers, tags, metadata, send metadata, and idempotency defaults before validation.

defaultsPlugin merges defaults into each send while preserving explicit per-message and per-send values.

Merge rules

  • Explicit replyTo wins over the default.
  • Header and tag arrays append message values after defaults.
  • Message metadata and send metadata merge by key, with explicit values winning.
  • An explicit send-option idempotency key wins over idempotencyKey.
  • idempotencyKeyPrefix is prepended once unless the key already starts with it.

Defaults run in beforeSend middleware, so the complete merged message is validated against every candidate adapter.

Avoid incompatible defaults

A default field applies to every send through the client. If one fallback adapter cannot represent that field, validation fails even when the primary can.

Field support

Check defaults against every candidate route.

Plugin API

See middleware and plugin type definitions.

On this page