@relayapp/vercel-ai turns a Vercel AI SDK backend into
a Relay agent: it receives signed message.received webhooks and forwards
streamText(...) output to Relay, which commits one canonical message. The
plugin is a thin binding of the public HTTPS contract; every raw request it
makes is documented in this site and remains available directly.
Prerequisites: an agent and its Agent Token
(Create and connect an agent) and a registered webhook
with its signing secret (Webhooks).
The plugin lives in the public
relaymessenger/relayapp
workspace under integrations/vercel-ai and publishes to npm with the next
relayapp release.Quickstart
app/api/relay/route.ts
What the plugin enforces
Each row is a contract from these docs that the plugin implements for you.Configuration
On serverless platforms that support work after the response, pass the
platform’s
waitUntil as the second handler argument to acknowledge 202
immediately and keep generating: relay.webhook(handler) returns a function
of (request, { waitUntil }).
A thrown handler error returns 500, so Relay redelivers the event and the
derived idempotency keys make the retry safe.
Handler context
Next steps
- Streaming for the one-canonical-message contract behind
reply.stream - Message components to send buttons, selects, and cards from
reply.parts - Webhooks for registration, verification, and secret rotation
- Text your coding agent for the local-computer integrations