AbsoluteJS

@absolutejs/dispatch-resend

@absolutejs/dispatch-resendv0.7.0betaMessaging

Resend-backed EmailAdapter with credential-safe installed effects, signed evidence, and reference-gated query recovery.

#Installation

BASH
bun add @absolutejs/dispatch-resend

#Capabilities

Overview

Resend-backed EmailAdapter for @absolutejs/dispatch.

Docs: absolutejs.com/documentation/dispatch#adapters

API

tagsFromMetadata

By default the adapter maps every string-valued entry in message.metadata to a Resend tag. Non-string values (numbers, booleans, objects) are filtered out — Resend requires string for both name and value.

Override to customize:

Error mapping

Resend's { data, error } response shape becomes:

error set → adapter throws (@absolutejs/dispatch records the

exception on the dispatch.email.send span, bumps failed counter, emits dispatch.email.failed audit event).

Show 3 more

data.id present → DispatchResult.id = the Resend message id.

data.id missing → DispatchResult.id is undefined,

result.provider still 'resend'.

Durable effect webhook evidence

The effect driver adds an abs_effect Resend tag containing the durable effect ID and declares its complete webhook setup: callback template, Standard Webhooks headers, supported outbound events, exact secret alias, last-verified-event health signal, and signed-event replacement rotation. Hosts can pass the exact raw request body, Standard Webhooks headers, project tenant ID, and that project's exact RESEND_WEBHOOK_SECRET to verifyResendEffectWebhook(). It uses Resend's SDK verifier before returning a normalized EffectEvidenceRecord; recipients, sender, subject, headers, and the raw payload are never returned for storage.

The descriptor uses webhook-query: signed webhooks remain primary, while createResendEffectQueryDriver() can retrieve an ambiguous send only when Execution retained the exact Resend email ID returned by the original call. The execution driver extracts that bounded reference without retaining the provider response. The query fallback verifies the retrieved email ID and its abs_effect tag before returning normalized evidence. If an ambiguous network call returned no ID, the runtime skips this fallback before resolving the API key and continues waiting for signed webhook or operator evidence; it never replays the send.

All supported outbound email. webhook events confirm that the email.send effect was accepted by Resend, so the normalized effect outcome is confirmed_succeeded. Delivery state remains explicit in eventType (for example email.delivered, email.bounced, or email.failed) and must not be confused with successful inbox delivery. Inbound email.received, contact, domain, uncorrelated, and invalidly signed events are rejected.

Show 1 more

Webhook signing secrets are host ingress credentials, not provider-send credentials. Store one under the exact project secret alias RESEND_WEBHOOK_SECRET; do not place it in an adapter installation or resolve it during email sends.

Outcomes

What you can build

Build on the supported package contract

Use @absolutejs/dispatch-resend through its supported public entry points.

Hardening checklist

Production guidance

Make every external boundary explicitPin the deployed @absolutejs/dispatch-resend version, replace example or memory-backed dependencies with durable implementations, bound external calls, protect credentials, and emit enough evidence to retry or recover safely.

Follow in order

Troubleshooting path

1
Trace from the first failed boundary
Reproduce the smallest canonical @absolutejs/dispatch-resend example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#Usage

Partial snippet

Working example for Usage.

TS
import { Resend } from "resend";
import { createDispatcher } from "@absolutejs/dispatch";
import { createResendAdapter } from "@absolutejs/dispatch-resend";

const resend = new Resend(process.env.RESEND_KEY!);

const dispatcher = createDispatcher({
  email: createResendAdapter({
    client: resend,
    defaultFrom: "no-reply@acme.io",
  }),
});

const result = await dispatcher.email({
  to: "alice@example.com",
  subject: "Welcome to Acme",
  text: "Click here to verify: ...",
  // String metadata becomes Resend tags by default:
  metadata: { campaign: "welcome-v2", priority: "high" },
});

console.log(result.id); // Resend's message id

#API

Partial snippet

Working example for API.

TS
createResendAdapter({
  client,         // Required — your `new Resend(apiKey)`
  defaultFrom?,   // Required if your messages don't set `from`
  tagsFromMetadata?,  // Customize metadata → Resend tags mapping
})

#tagsFromMetadata

Partial snippet

By default the adapter maps every string-valued entry in message.metadata to a Resend tag. Non-string values (numbers, booleans, objects) are filtered out — Resend requires string for both name and value.

TS
createResendAdapter({
  client: resend,
  tagsFromMetadata: (metadata) => [
    // Always include the tenant
    ...(typeof metadata.tenant === "string"
      ? [{ name: "tenant", value: metadata.tenant }]
      : []),
    // Drop debug-only entries
  ],
});

#Public entry points

Supported entry points declared by this package manifest.

Package entry point declared in package.json.

@absolutejs/dispatch-resend@absolutejs/dispatch-resend/manifest@absolutejs/dispatch-resend/manifest.json

#Package commands

Scripts declared by this package manifest.

bun run buildrm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --sourcemap --target=bun --external @absolutejs/dispatch --external '@absolutejs/dispatch/*' --external @absolutejs/execution --external '@absolutejs/execution/*' --external @absolutejs/manifest --external @sinclair/typebox --external resend --external 'resend/*' && tsc --project tsconfig.build.json && absolute-manifest emit
bun run check:packagebun run format && bun run typecheck && bun run test && bun run verify-package && bun run build && bun run verify-package --artifacts
bun run formatprettier --write "./**/*.{ts,json,md}"
bun run testbun test
bun run typechecktsc --noEmit

#API reference

Search the declarations exported by the current package type files. Expand a symbol to inspect its source-backed signature.

18 symbols
RESEND_EFFECT_ADAPTER_IDvaluePermalinkSource
TS
const RESEND_EFFECT_ADAPTER_ID = "absolutejs.dispatch-resend";
Exported from @absolutejs/dispatch-resend