--- title: Feishu (Lark) description: Integrate CowAgent into Feishu application --- Integrate CowAgent into Feishu by creating a custom enterprise app. You need to be a Feishu enterprise user with admin privileges. ## 1. Create Enterprise Custom App ### 1.1 Create App Go to [Feishu Developer Platform](https://open.feishu.cn/app/), click **Create Enterprise Custom App**, fill in the required information and click **Create**: ### 1.2 Add Bot Capability In **Add App Capabilities**, add **Bot** capability to the app: ### 1.3 Configure App Permissions Click **Permission Management**, paste the following permission string into the input box below **Permission Configuration**, select all filtered permissions, click **Batch Enable** and confirm: ``` im:message,im:message.group_at_msg,im:message.group_at_msg:readonly,im:message.p2p_msg,im:message.p2p_msg:readonly,im:message:send_as_bot,im:resource,cardkit:card:write ``` `cardkit:card:write` is used for streaming typewriter replies (creating and updating streaming cards). You can skip it if streaming is not needed. ## 2. Project Configuration 1. Get `App ID` and `App Secret` from **Credentials & Basic Info**: 2. Add the following configuration to `config.json` in the project root: ```json { "channel_type": "feishu", "feishu_app_id": "YOUR_APP_ID", "feishu_app_secret": "YOUR_APP_SECRET", "feishu_stream_reply": true } ``` | Parameter | Description | Default | | --- | --- | --- | | `feishu_app_id` | Feishu bot App ID | - | | `feishu_app_secret` | Feishu bot App Secret | - | | `feishu_stream_reply` | Enable streaming typewriter reply (powered by Feishu cardkit streaming card API). Disable to return the full text at once. | `true` | > **Streaming requirements**: requires `cardkit:card:write` permission on the bot, and recipient Feishu client version ≥ 7.20. Older clients will see a "please upgrade" placeholder; if the permission is missing, replies automatically fall back to plain text. Start the project after configuration is complete. ## 3. Configure Event Subscription 1. After the project is running successfully, go to the Feishu Developer Platform, click **Events & Callbacks**, select **Long Connection** mode, and click save: 2. Click **Add Event** below, search for "Receive Message", select "**Receive Message v2.0**", and confirm. 3. Click **Version Management & Release**, create a new version and apply for **Production Release**. Check the approval message in the Feishu client and approve: Once completed, search for the bot name in Feishu to start chatting.