velt-chat-sdk-adapter-best-practices

Implement server-side bots that respond to mentions in Velt comment threads via webhooks.

1|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/velt-js/agent-skills --skill velt-chat-sdk-adapter-best-practices-velt-js
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: velt-chat-sdk-adapter-best-practices
Source: https://github.com/velt-js/agent-skills/tree/main/skills/velt-chat-sdk-adapter-best-practices
Command: npx skills add https://github.com/velt-js/agent-skills --skill velt-chat-sdk-adapter-best-practices-velt-js

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @veltdev/chat-sdk-adapter, chat, @chat-adapter/state-memory, @chat-adapter/state-redis, @vercel/functions.

What problem does it solve? Building a bot that replies to @-mentions in Velt comment threads requires correctly wiring webhook signature verification, event dispatch, user resolution, and thread subscriptions — mistakes cause feedback loops, dropped replies on serverless platforms, or failed verification. ## Core Features & Use Cases - Adapter Configuration: Set up createVeltAdapter with bot identity, organization scoping, auto-generated auth tokens, and v1/v2 webhook secrets. - Event Handling: Implement onNewMention, onSubscribedMessage, and onReaction handlers with thread.subscribe() and thread.post() for multi-turn conversations, including streaming LLM replies via the Vercel AI SDK. - Deployment Patterns: Configure Next.js App Router webhook routes with runtime = "nodejs", force-dynamic, and waitUntil for Vercel or other Node.js platforms. - Use Case: Build an AI support bot that fetches Velt thread history, sends it to Claude, and streams the answer back into the comment thread while handling follow-up messages. ## Quick Start Ask the agent to set up the Velt Chat SDK Adapter with a webhook endpoint in your Next.js app so a bot replies when users @-mention it in Velt comments.

Frequently Asked Questions about velt-chat-sdk-adapter-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a bot that responds to @-mentions in Velt comments?▼

Create a lazy singleton Chat instance with createVeltAdapter, register an onNewMention handler that calls thread.subscribe() and thread.post(), and expose a POST webhook route. Enable comment.add and comment_annotation.add events in the Velt Console.

Velt webhook v1 vs v2: which should I use?▼

Use v2 (Advanced), which is the adapter default. It verifies requests with Svix-style HMAC-SHA256 signatures and rejects events older than 5 minutes, while v1 only checks a Basic Authorization token with no replay protection.

Why is my Velt webhook signature verification failing in Next.js?▼

Verification fails on the Edge runtime because it requires Node's crypto module. Set export const runtime = "nodejs" and export const dynamic = "force-dynamic" on the route, and confirm VELT_WEBHOOK_SECRET matches the Velt Console value.

Can a bot add reactions to Velt comments programmatically?▼

Reading reactions via onReaction works on all managed plans, but writing reactions with addReaction or removeReaction throws a PermissionError on the managed backend. Programmatic reaction writes require configuring selfHostingConfig.reactionsService with a self-hosted data backend.

Why does my Velt bot reply to its own messages in a loop?▼

Feedback loops occur when botUserId does not match the user ID on the bot's posted replies. The adapter filters webhook events whose actionUser.userId equals botUserId, so keep that ID unique and stable across deployments.

How do I keep Velt bot thread subscriptions after server restarts?▼

Replace createMemoryState() with createRedisState() from @chat-adapter/state-redis. In-memory state loses thread subscriptions on restart, so onSubscribedMessage stops firing for previously subscribed threads.