> ## Documentation Index
> Fetch the complete documentation index at: https://docs.veadk.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy as a Feishu bot

Wire an agent up as a **Feishu bot**: after deploying the runtime, `agentkit release` also deploys a Feishu proxy on VeFaaS that bridges Feishu and the runtime. The proxy connects out to Feishu over **WebSocket** (no public callback URL required), then calls the runtime with its `key_auth` credential.

```mermaid theme={null}
flowchart LR
  A["Feishu"] -->|WebSocket| B["Feishu proxy · VeFaaS"]
  B -->|key_auth| C["Runtime"]
```

<Note>
  First, follow [Authentication and login](/productions/agentkit-cli/archives/0.51.0/en/commands/auth) to configure AK/SK credentials or complete SSO login. Then create an app on the [Feishu Open Platform](https://open.feishu.cn/), enable the **bot** capability, and note the **App ID** and **App Secret** (Feishu has no API to create an app — do this once in the console).
</Note>

<Steps>
  <Step title="Create a Feishu app">
    On the Feishu Open Platform, create a **custom app**, enable the bot capability, and get the App ID and App Secret from "Credentials & Basic Info".
  </Step>

  <Step title="Scaffold a project">
    ```bash lines theme={null}
    agentkit init my-agent --template basic
    cd my-agent
    agentkit release config --name my-agent
    ```
  </Step>

  <Step title="Declare the Feishu channel (edit .agentkit/agentkit.yaml)">
    Add an `im.feishu` block; credentials use `${VAR}` and stay out of the repo:

    ```yaml title=".agentkit/agentkit.yaml" lines theme={null}
    im:
      feishu:
        enabled: true
        app_id: ${FEISHU_APP_ID}
        app_secret: ${FEISHU_APP_SECRET}
    ```
  </Step>

  <Step title="Fill in the environment variables">
    Put the values in `.env` — the CLI loads it automatically on deploy:

    ```bash title=".env" lines theme={null}
    FEISHU_APP_ID=...
    FEISHU_APP_SECRET=...
    ```
  </Step>

  <Step title="Deploy">
    ```bash lines theme={null}
    agentkit release
    ```

    No flags. `agentkit release` reads `.agentkit/agentkit.yaml`: it builds and deploys the runtime (`key_auth`), then deploys the Feishu proxy (WebSocket transport — no public callback URL to configure).
  </Step>

  <Step title="Chat in Feishu">
    Find your bot in Feishu and message it; the proxy forwards messages to the runtime and sends the replies back to Feishu.
  </Step>
</Steps>

Notes:

* **WebSocket transport**: the proxy dials out to Feishu, so no public callback address and no event-subscription URL are needed.
* **Credentials**: App ID and Secret use `${VAR}` and are never committed; `agentkit release` reuses the same proxy function idempotently — redeploys update rather than create new ones.
* **Message experience**: incoming messages get an acknowledgement reaction, and the reply streams into a live card; the model's thinking and tool calls are tucked into a separate panel that stays collapsed until you expand it.
* **Sessions & multi-tenancy**: the Feishu user maps to the runtime user and the Feishu chat maps to the runtime session, isolated per tenant — so one proxy can serve many tenants without their sessions or memory bleeding into each other.
* **Runtime auth**: on the Feishu path the runtime uses `key_auth` (the proxy holds the API key). For web login with per-user identity forwarding, see [Deploy a frontend with SSO login](/productions/agentkit-cli/archives/0.51.0/en/workflows/frontend-sso).
