Looking for the chatbot template? It's now here.
GitHub

@bitbasti/chat-adapter-webex

Community Webex adapter for Chat SDK.

Installation

bash
npm install chat @bitbasti/chat-adapter-webex

Usage

ts
import { Chat } from "chat";import { createWebexAdapter } from "@bitbasti/chat-adapter-webex";const bot = new Chat({  userName: "mybot",  adapters: {    webex: createWebexAdapter({      botToken: process.env.WEBEX_BOT_TOKEN!,      webhookSecret: process.env.WEBEX_WEBHOOK_SECRET,    }),  },});bot.onNewMention(async (thread, message) => {  await thread.post(`Hello from Webex! You said: ${message.text}`);});

Environment variables

VariableRequiredDescription
WEBEX_BOT_TOKENYesBot access token from the Webex Developer Portal
WEBEX_WEBHOOK_SECRETRecommendedShared secret for webhook signature verification
WEBEX_BASE_URLNoOverride the Webex API base URL (default: https://webexapis.com/v1)
WEBEX_BOT_USERNAMENoOverride the bot display name

Configuration

OptionTypeDefaultDescription
botTokenstringWEBEX_BOT_TOKENBot access token
webhookSecretstringWEBEX_WEBHOOK_SECRETShared secret for verifying webhook signatures
baseUrlstring"https://webexapis.com/v1"Webex API base URL
userNamestring"webex-bot"Bot display name (overridden by the bot's Webex profile on initialization)
botUserIdstringAuto-detected via /people/meWebex person ID of the bot (skips the /people/me call if provided)
loggerLoggerConsoleLoggerCustom logger instance

Platform setup

  1. Go to the Webex Developer Portal and sign in.
  2. Navigate to My Webex AppsCreate a New AppCreate a Bot.
  3. Fill in the bot name, username, and icon, then click Add Bot.
  4. Copy the Bot Access Token — this is your WEBEX_BOT_TOKEN. Store it securely; it is only shown once.
  5. Create a webhook pointing to your server:
    • Target URL: https://your-domain.com/api/webhooks/webex
    • Resource: messages | Event: created
    • Resource: attachmentActions | Event: created
    • Secret: a random string — this is your WEBEX_WEBHOOK_SECRET
  6. Add the bot to a Webex space and mention it to verify the integration.

See the Webex Webhooks Guide for details on webhook registration.

Features

  • Mentions and DMs
  • Rich text (bold, italic, code, links) via Markdown
  • Adaptive Cards (buttons, selects, radio selects, fields, sections)
  • Modals (form cards with submit/close actions)
  • File uploads (single file per message)
  • Thread support (parentId-based threading)
  • Webhook signature verification (HMAC-SHA1)

Limitations

  • Reactions are not supported by Webex bot tokens — addReaction / removeReaction throw NotImplementedError
  • Typing indicators are not available in the Webex Messaging API
  • Only one file upload per message is supported
  • Cards and file uploads cannot be combined in the same message

License

MIT