All integrations

X

ChannelChat SDK

Public mentions and DMs on X via the Chat SDK.

Read the full channel docs

Install

Install eve, the Chat SDK core (chat), the X adapter, and a state adapter:

bash
npm install eve@latest chat @chat-adapter/x @chat-adapter/state-memory

The in-memory state store is fine for local development; use a durable state adapter (Redis, PostgreSQL) in production so thread subscriptions survive restarts.

Quick start

Create agent/channels/x.ts. Register Chat SDK handlers on bot, call send to hand each turn to eve, and export the channel:

ts
// agent/channels/x.tsimport { createXAdapter } from "@chat-adapter/x";import { createMemoryState } from "@chat-adapter/state-memory";import { chatSdkChannel } from "eve/channels/chat-sdk";
export const { bot, channel, send } = chatSdkChannel({  userName: "My Agent",  adapters: { x: createXAdapter() },  state: createMemoryState(),});
bot.onNewMention(async (thread, message) => {  await thread.subscribe();  await send(message.text, { thread });});
bot.onSubscribedMessage(async (thread, message) => {  await send(message.text, { thread });});
export default channel;

Credentials come from the createXAdapter config or the adapter's environment variables; see the X adapter docs.

Configure

The adapter mounts its webhook at /eve/v1/x. Point your X account activity webhook at it. The adapter owns provider auth, verification, and delivery, while eve owns session dispatch, streaming, typing, and human-in-the-loop. See the Chat SDK channel docs for routes, streaming, and state options.