Skip to content

feat(tests): add Vercel Connect webhook contract helper#654

Open
bensabic wants to merge 1 commit into
vercel-connect/basefrom
vercel-connect/tests
Open

feat(tests): add Vercel Connect webhook contract helper#654
bensabic wants to merge 1 commit into
vercel-connect/basefrom
vercel-connect/tests

Conversation

@bensabic

Copy link
Copy Markdown
Contributor

Adds connectWebhookContract to @chat-adapter/tests: a shared Vitest suite that verifies a Connect-capable adapter's webhook verification. Given a small per-adapter descriptor, it asserts the behavior every Connect adapter shares — a webhookVerifier replaces the native signature/secret check and gates inbound requests (200 on a truthy result, 401 on a thrown error or falsy result) and is invoked with the request and raw body.

The helper depends only on chat types and is self-tested against a fake adapter, so it lives entirely under packages/tests.

Stacked on #647 (base vercel-connect/base).

Companion

@vercel/connect/chat subpath: vercel/vercel#16826.

Add `connectWebhookContract` to `@chat-adapter/tests`: a shared Vitest
suite that verifies a Connect-capable adapter's webhook verification.
Given a small per-adapter descriptor, it asserts the behavior every
Connect adapter shares — a `webhookVerifier` replaces the native
signature/secret check and gates inbound requests (200 on truthy, 401 on
throw/falsy) and is invoked with the request and raw body.

The helper depends only on `chat` types and is self-tested against a fake
adapter, so it lives entirely under packages/tests with no dependency on
any adapter's Connect support. Wiring each real adapter to call it is a
follow-up on the adapter branches.

Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
@bensabic bensabic requested a review from a team as a code owner June 30, 2026 07:42
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat Ready Ready Preview, Comment, Open in v0 Jun 30, 2026 7:43am
chat-sdk-nextjs-chat Ready Ready Preview, Comment, Open in v0 Jun 30, 2026 7:43am
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant