# Adeli for Chat SDK: Instagram, WhatsApp and TikTok Bots

@adeli/chat-sdk-adapter lets a Chat SDK bot answer Instagram, Facebook and WhatsApp DMs and Instagram and TikTok comments with one Adeli API key.

Canonical page: https://www.tryadeli.com/blog/chat-sdk-adapter
Last updated: 2026-11-06

By Nick Reyes, Co-founder and CTO, Adeli. Published 2026-11-06.

## The short answer

@adeli/chat-sdk-adapter is an Adeli adapter for Vercel's Chat SDK. One bot, with one Adeli API key, answers Instagram, Facebook and WhatsApp DMs, shows up to three tappable buttons on Instagram DMs, and replies to Instagram and TikTok comments. Your users connect their accounts in Adeli, so the bot needs no Meta app, App Review or TikTok developer access.

[Chat SDK](https://chat-sdk.dev/docs) lets you write a bot once and run it on Slack, Teams, Discord and other chat platforms through adapters. Today we're releasing `@adeli/chat-sdk-adapter`, which adds Instagram, Facebook and WhatsApp DMs, and Instagram and TikTok comments, to that list. The bot uses one Adeli API key, and your users connect their own accounts in the Adeli dashboard. You don't need a Meta app, App Review, or TikTok developer access.

## What's new

- A new DM on Instagram, Facebook or WhatsApp reaches `onNewMention`, and follow-ups in a subscribed thread reach `onSubscribedMessage`.
- A new top-level comment on an Instagram post or TikTok video counts as a mention too, and `thread.post()` replies under it.
- On Instagram DMs, a card's `<Button>` and `<LinkButton>` become native buttons, up to three per message, and a tap arrives as `onAction`.
- `apiKey` and `webhookSecret` accept a function, which the adapter calls on every request and every webhook, so you can rotate keys without a restart.

To support it, Adeli's public API gained a `message.created` webhook for inbound Instagram, Facebook and WhatsApp DMs, conversation-scoped message history, and WhatsApp free-text sends. They're documented in the [webhooks reference](https://www.tryadeli.com/docs/api/webhooks) and [List messages](https://www.tryadeli.com/docs/api/messages/list-messages), so you can use them without Chat SDK too.

## How to use it

Install the adapter and Chat SDK:

```bash
npm install chat @adeli/chat-sdk-adapter @chat-adapter/state-memory
```

Create the bot:

```ts
import { Chat } from "chat";
import { createMemoryState } from "@chat-adapter/state-memory";
import { createAdeliAdapter } from "@adeli/chat-sdk-adapter";

export const bot = new Chat({
  userName: "shopbot",
  adapters: {
    adeli: createAdeliAdapter({
      apiKey: process.env.ADELI_API_KEY!,
      webhookSecret: process.env.ADELI_WEBHOOK_SECRET!,
    }),
  },
  state: createMemoryState(),
});

bot.onNewMention(async (thread, message) => {
  await thread.subscribe();
  await thread.post(`Thanks for reaching out! You said: ${message.text}`);
});
```

Then serve `bot.webhooks.adeli` from a route such as `/api/webhooks/adeli`, and register that URL as an Adeli webhook for `message.created`, `message.postback` and `comment.created`. The [Chat SDK adapter docs](https://www.tryadeli.com/docs/chat-sdk) cover the webhook, the Next.js route, the thread model and the full feature table.

## What to know first

- Instagram, Facebook and WhatsApp accept free-text messages only within 24 hours of the person's last message. Outside that window, a post throws `AdapterError` with code `window_closed`. To open a WhatsApp conversation, send an approved template with `@adeli/sdk`.
- None of these platforms lets a bot edit a sent DM, so the adapter buffers a streamed reply and posts it once. Reactions aren't supported, and `startTyping` does nothing.
- Every bot reply counts as a message or comment in your Adeli usage. A workspace on the [free tier](https://www.tryadeli.com/pricing) gets a rate-limit error once it has used its monthly sends.

The source is at [github.com/kingscrosslabs/adeli-chat-sdk-adapter](https://github.com/kingscrosslabs/adeli-chat-sdk-adapter), under the MIT license.

## Frequently asked questions

### Which platforms does the Adeli Chat SDK adapter support?

Instagram, Facebook and WhatsApp direct messages, and comments on Instagram posts and TikTok videos. Cards with buttons render as native buttons on Instagram DMs, up to three per message, and as plain text everywhere else.

### Can the bot message someone on WhatsApp at any time?

No. Meta allows free-text replies only within 24 hours of the person's last message. Outside that window the adapter throws a window_closed error, and you open the conversation with an approved template through @adeli/sdk.

## Related Adeli pages

- [Social Media Messaging API](https://www.tryadeli.com/social-media-messaging-api.md): Read Instagram, Facebook, and WhatsApp messages and reply to Instagram and Facebook DMs through the same API you publish with. No outbound or unsolicited messaging.
- [Social Media Commenting API](https://www.tryadeli.com/social-media-commenting-api.md): Read, reply to, and moderate comments on Instagram, TikTok, YouTube, and Facebook posts through the same API you publish with.
- [All posts on the Adeli blog](https://www.tryadeli.com/blog.md)

## About the author

Nick Reyes is the CTO of Adeli. Previously he worked in security, cryptography, and authentication systems, with 10 years of experience at Google, Airbnb, and Phantom.
