logo
icon

OpenAB Gateway

Standalone webhook gateway for OpenAB — bridges Telegram, LINE, Feishu/Lark, Google Chat, and MS Teams to any running OAB instance via WebSocket. Deploy alongside an existing OpenAB service to enable messaging platform support. At least one platform must be configured. Source: https://github.com/openabdev/openab

template cover
Deployed11 times
PublisherzeaburZeabur
Created2026-04-25
Tags
AIDeveloper ToolsTelegramLINEFeishuGoogle ChatTeams

OpenAB Gateway

OpenAB Gateway is a standalone webhook bridge that connects messaging platforms to any running OpenAB instance via WebSocket.

Telegram     ──POST──▶ ┌──────────────────┐
LINE         ──POST──▶ │                  │
Feishu/Lark  ──POST──▶ │  OpenAB Gateway  │ ◀──WebSocket── OAB Pod
Google Chat  ──POST──▶ │     :8080        │   (OAB connects out)
MS Teams     ──POST──▶ │                  │
                       └──────────────────┘

Deploy this template alongside an existing OpenAB service (Claude, Cursor, Codex, etc.) to add messaging support without redeploying OAB. Configure one or more of the supported platforms — leave the rest blank to disable them.

Supported Platforms

PlatformSetup sectionRequired variables
Telegram#telegramTELEGRAM_BOT_TOKEN
LINE#lineLINE_CHANNEL_SECRET, LINE_CHANNEL_ACCESS_TOKEN
Feishu / Lark#feishuFEISHU_APP_ID, FEISHU_APP_SECRET
Google Chat#google-chatGOOGLE_CHAT_ENABLED=true, GOOGLE_CHAT_SA_KEY_JSON
MS Teams#teamsTEAMS_APP_ID, TEAMS_APP_SECRET

Prerequisites

  • A running OpenAB service (any variant) in the same Zeabur project
  • At least one of the supported platforms above configured

Setup

1. Create a Telegram Bot

  1. Open @BotFather in Telegram
  2. Send /newbot and follow the prompts
  3. Copy the bot token (e.g. 123456:ABC-DEF...) → paste into Telegram Bot Token
  4. Optional: send /setprivacyDisable so the bot sees all group messages

2. Deploy

Fill in the tokens for the platform(s) you want to enable and click deploy. A public HTTPS domain is auto-assigned. You can enable Telegram only, LINE only, or both.

3. Register the Telegram Webhook

After deployment, register your gateway URL with Telegram (replace YOUR_TOKEN, YOUR_DOMAIN, and optionally YOUR_SECRET):

# Without webhook secret (simpler, less secure)
curl "https://api.telegram.org/botYOUR_TOKEN/setWebhook?url=https://YOUR_DOMAIN/webhook/telegram"

# With webhook secret (recommended — matches TELEGRAM_SECRET_TOKEN you set)
curl "https://api.telegram.org/botYOUR_TOKEN/setWebhook?url=https://YOUR_DOMAIN/webhook/telegram&secret_token=YOUR_SECRET"

Expected response: {"ok":true,"result":true,"description":"Webhook was set"}

4. Configure OAB to Use the Gateway

In your OpenAB service (same Zeabur project), edit /home/agent/.config/openab/config.toml and add:

[gateway]
url = "ws://openab-gateway:8080/ws"

Then restart the OpenAB service. OAB connects outbound to the gateway — no inbound ports needed on OAB.

Internal hostname: openab-gateway resolves within the same Zeabur project via internal DNS. If your gateway service has a different name, use that name instead.

5. Test

Send a message to your Telegram bot. The gateway receives it and forwards it to OAB via WebSocket. OAB processes it and replies through the gateway.

LINE Setup (Optional)

1. Create a LINE Official Account

  1. Go to LINE Official Account Manager and create a new account
  2. SettingsMessaging APIEnable Messaging API
  3. Open LINE Developers Console → your channel:
    • Basic settingsChannel secret → copy → paste into LINE Channel Secret
    • Messaging APIChannel access token → Issue → copy → paste into LINE Channel Access Token

2. Set Webhook URL

In LINE Developers Console → Messaging API tab:

  1. Webhook URL → Edit → enter: https://YOUR_DOMAIN/webhook/line
  2. Use webhook → ON
  3. Auto-reply messages → OFF
  4. Click Verify

3. Configure OAB for LINE

In config.toml, add platform = "line" to the gateway section:

[gateway]
url = "ws://openab-gateway:8080/ws"
platform = "line"

Restart the OpenAB service after saving.

Feishu / Lark Setup (Optional)

  1. Create an app at open.feishu.cn (China) or open.larksuite.com (international).
  2. Enable the Bot capability.
  3. Event Subscriptions → choose Long Connection (WebSocket) mode → add the im.message.receive_v1 event.
  4. Permissions & Scopes → grant: im:message, im:message:send_as_bot, contact:user.base:readonly.
  5. From Credentials & Basic Info, copy App IDFEISHU_APP_ID, App SecretFEISHU_APP_SECRET.
  6. Set FEISHU_DOMAIN to lark if using Lark international, otherwise leave at feishu.

Default connection mode is WebSocket — the gateway connects outbound to Feishu, no inbound webhook URL needed.

Then configure OAB to use the gateway with platform = "feishu":

[gateway]
url = "ws://openab-gateway:8080/ws"
platform = "feishu"

Full guide: docs/feishu.md

Google Chat Setup (Optional)

Requires a Google Workspace account (Business/Enterprise tier). Consumer @gmail.com accounts cannot create Google Chat apps.

  1. In Google Cloud Console, enable the Google Chat API in your project.
  2. APIs & Services → Google Chat API → Configuration:
    • Connection settingsApp URL → enter https://YOUR_DOMAIN/webhook/googlechat
    • Authentication Audience → leave as HTTP Endpoint URL
  3. Create a Service Account (no special roles needed) and download a JSON key.
  4. Set the env vars:
    • GOOGLE_CHAT_ENABLED=true
    • GOOGLE_CHAT_SA_KEY_JSON → paste the full Service Account JSON (single line)
    • GOOGLE_CHAT_AUDIENCEhttps://YOUR_DOMAIN/webhook/googlechat (recommended for JWT verification)

Configure OAB with platform = "googlechat". Full guide: docs/google-chat.md

MS Teams Setup (Optional)

  1. Register a Bot Framework app at dev.botframework.com or via Azure Bot Service.
  2. Set the Messaging endpoint to https://YOUR_DOMAIN/webhook/teams.
  3. From the bot's app registration, copy App IDTEAMS_APP_ID, generate a client secret → TEAMS_APP_SECRET.
  4. Add the bot to your Teams tenant and install it in a channel or chat.

Configure OAB with platform = "teams". Full guide: docs/msteams-selfhosted.md

Webhook Endpoints

PathPlatform
POST /webhook/telegramTelegram
POST /webhook/lineLINE
POST /webhook/feishuFeishu/Lark (webhook mode only; default uses WebSocket)
POST /webhook/googlechatGoogle Chat
POST /webhook/teamsMS Teams
GET /wsOAB WebSocket (internal)
GET /healthHealth check