Back to Eliza

Zalo Connector

packages/docs/connectors/zalo.md

2.0.14.0 KB
Original Source

Zalo Connector

Connect your agent to Zalo for Official Account messaging and support workflows using the @elizaos/plugin-zalo package.

A personal-account variant is also available as @elizaos/plugin-zalouser.

Prerequisites

Package Info

FieldValue
Package@elizaos/plugin-zalo
Config keyconnectors.zalo
Installeliza plugins install @elizaos/plugin-zalo

Setup

1. Create a Zalo Official Account

  1. Go to the Zalo Developers portal
  2. Create an application and obtain your App ID and App Secret
  3. Generate an access token and refresh token for API access

2. Configure Eliza

NameRequiredDescription
ZALO_ACCESS_TOKENYesOA access token
ZALO_SECRET_KEYYesApplication secret key
ZALO_APP_IDNoApplication ID
ZALO_REFRESH_TOKENNoToken refresh credential
ZALO_ENABLEDNoEnable or disable the connector
ZALO_PROXY_URLNoProxy URL for API requests
ZALO_USE_POLLINGNoUse polling instead of webhooks
ZALO_WEBHOOK_URLNoWebhook URL for inbound messages
ZALO_WEBHOOK_PATHNoWebhook endpoint path
ZALO_WEBHOOK_PORTNoWebhook listener port

Install the plugin from the registry:

bash
eliza plugins install zalo

Configure in ~/.eliza/eliza.json:

json
{
  "connectors": {
    "zalo": {
      "accessToken": "YOUR_ACCESS_TOKEN",
      "secretKey": "YOUR_SECRET_KEY",
      "refreshToken": "YOUR_REFRESH_TOKEN",
      "appId": "YOUR_APP_ID"
    }
  }
}

Or via environment variables:

bash
export ZALO_ACCESS_TOKEN=YOUR_ACCESS_TOKEN
export ZALO_SECRET_KEY=YOUR_SECRET_KEY
export ZALO_REFRESH_TOKEN=YOUR_REFRESH_TOKEN
export ZALO_APP_ID=YOUR_APP_ID

Environment Variables

VariableRequiredDescription
ZALO_ACCESS_TOKENYesOA access token
ZALO_SECRET_KEYYesApplication secret key
ZALO_REFRESH_TOKENNoToken refresh credential
ZALO_APP_IDNoApplication ID

Configuration Reference

FieldRequiredDescription
accessTokenYesZalo API access token
secretKeyYesZalo application secret key
refreshTokenNoZalo API refresh token
appIdNoZalo application ID
enabledNoSet false to disable (default: true)

Features

  • Official Account messaging and support workflows
  • Webhook-based message handling
  • Polling mode as alternative to webhooks
  • Customer interaction management
  • Token refresh support

Zalo User (Personal Account)

A separate connector, @elizaos/plugin-zalouser, provides personal Zalo account messaging (as opposed to Official Account). Install it with:

bash
eliza plugins install zalouser

Package Info

FieldValue
Package@elizaos/plugin-zalouser
Config keyconnectors.zalouser
Categoryconnector

Configuration

json
{
  "connectors": {
    "zalouser": {
      "enabled": true
    }
  }
}

Environment Variables

VariableRequiredDescription
ZALO_ACCESS_TOKENYesOA access token
ZALO_SECRET_KEYYesApplication secret key
ZALO_REFRESH_TOKENNoToken refresh credential
ZALO_APP_IDNoApplication ID
ZALO_ENABLEDNoEnable or disable the connector
ZALO_WEBHOOK_URLNoWebhook URL for receiving messages
ZALO_WEBHOOK_PATHNoWebhook endpoint path
ZALO_WEBHOOK_PORTNoWebhook listener port
ZALO_PROXY_URLNoProxy URL for API requests
ZALO_USE_POLLINGNoUse polling instead of webhooks

Features

  • Official Account messaging and support workflows
  • Webhook-based message handling
  • Customer interaction management