Skip to main content

Feishu / Lark Setup

Overview

The Feishu / Lark channel connects Anyy to Feishu chats. The adapter supports direct messages, groups, thread context, webhook mode, inbound media, lifecycle startup, and live-smoke checks.

The setup helper defaults to websocket connection mode.

Prerequisites

  • A Feishu / Lark app.
  • app_id.
  • app_secret.
  • Required receive/send permissions for the chats where Anyy should answer.
  • Optional verification token and encrypt key if you use webhook mode.

Setup

Create credentials

Create the app in the Feishu / Lark developer console and grant the message permissions needed by your deployment. Store the app secret with Anyy.

Configure Anyy

anyy setup channels feishu \
--set app_id=cli_xxxxxxxxxxxxx \
--secret app_secret='feishu-app-secret' \
--write-config

Optional secrets:

anyy setup channels feishu \
--set app_id=cli_xxxxxxxxxxxxx \
--secret app_secret='feishu-app-secret' \
--secret tenant_access_token='optional-token' \
--secret verification_token='optional-verification-token' \
--secret encrypt_key='optional-encrypt-key' \
--write-config

Setup defaults:

FieldDefault
account_idwork
connection_modewebsocket
receive_id_typechat_id
dm_policypairing
group_policymention
send_chunk_chars3800
media_max_bytes5242880

Start Gateway

anyy gateway start
anyy channels reload

Run doctor checks

anyy channels doctor feishu

Access Policy

Direct messages

The setup default is dm_policy: pairing. Use allowlist with Feishu sender ids when you need explicit access control.

Groups

The setup default is group_policy: mention. Use allow_groups and group_policy: allowlist for fixed chat access.

Admins

Feishu channel policy admits messages. Shared messaging command permissions decide which commands an admitted user can run.

Sessions

Accepted Feishu chats map to Anyy sessions. Thread fields are preserved when Feishu sends them.

Media Support

Inbound media

Feishu advertises inbound media support. Files are limited by media_max_bytes.

Outbound media

The current adapter does not advertise native outbound media.

Commands

Use the standard messaging commands. In group chats, mention the app when group_policy is mention.

Cron Delivery

anyy cron create \
--name "Feishu report" \
--schedule "0 18 * * *" \
--prompt "Send the daily report" \
--delivery-target current_user_default \
--delivery-channel feishu

Troubleshooting

  • No events arrive: confirm connection_mode, app permissions, and app credentials.
  • Webhook verification fails: check verification_token_ref and encrypt_key_ref.
  • Group message ignored: check mention behavior and group_policy.
  • Media missing: check Feishu permissions and media_max_bytes.