lark-channel
Lark/Feishu Channel SDK for Rust.
This repository is an early community scaffold for a Rust SDK that mirrors the role of the official Channel SDK family:
channel-sdk-gochannel-sdk-javachannel-sdk-pythonchannel-sdk-node
The first target is to support agent/bot bridges such as lark-coding-agent-bridge-rs: inbound events, normalized messages, streaming replies, media downloads, and interactive card callbacks.
Status
Experimental. The crate currently contains the public module skeleton, shared data types, an OpenAPI foundation for app and tenant access-token management, minimal outbound text messaging, replies, idempotency options, an early WebSocket endpoint/connection foundation, inbound message and card action parsing, normalized inbound text/post/mention handling, lightweight inbound resource descriptors, split-packet event reassembly, a single-connection event consumer, a reconnecting event loop with timer-driven heartbeat support, and a minimal echo bot example.
Planned Modules
config: app id/secret, Feishu/Lark domain selection, SDK source metadataevent: normalized inbound eventsmessage: normalized messages, outbound content, and high-level message sendingcard: interactive card primitivesmedia: resource descriptors and download/upload helpersclient: async client trait for transport implementationslark_openapi: low-level Feishu/Lark OpenAPI auth, transport, response parsing, IM message primitives, and WebSocket endpoint discovery
Crate Name
The repository is named channel-sdk-rust to match LarkSuite's official SDK naming style. The published Rust crate is lark-channel, and the Rust library target is lark_channel, so users can import it as:
= "0.4"
use ;
Examples
Examples live in examples.
The token example verifies the current OpenAPI foundation by requesting app and tenant access tokens:
The example reads credentials from environment variables. Applications using this SDK may load those values from their own configuration system, secret manager, or local .env workflow before constructing ChannelConfig.
ChannelConfig defaults to Domain::Feishu, which uses https://open.feishu.cn. Use Domain::Lark when targeting https://open.larksuite.com.
Minimal text messages can be sent through the high-level message sender:
use ;
use ;
// Inside async application code:
let app_id = "cli_xxx";
let app_secret = "app_secret";
let chat_id = "oc_xxx";
let config = new;
let openapi = new;
let sender = new;
let message_id = sender
.text_message
.send
.await?;
app_id and app_secret come from the Lark/Feishu developer console. See docs/messages.md for message semantics, docs/lark-api.md for the implemented Lark/Feishu OpenAPI mapping, and examples/README.md for runnable example configuration.
Roadmap
See docs/roadmap.md for the development plan.
The next milestones are:
- Rich content, cards, and streaming reply helpers.
- Media helper APIs.