Lark/Feishu Node SDK

Official Node.js SDK for building bots, cards, and integrations on Lark and Feishu.

SDK
npm
v1.74.0
294 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
60 /100 Good
Development Activity 72
Maintenance 32
Community 52
Maturity 56
Momentum 28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
70 /100 Good
Architecture 74
Code Quality 68
Innovation 66
Learning Curve 70

The Lark/Feishu Node SDK is the official server-side client for Lark Suite and Feishu’s Open Platform, the workplace collaboration suite used across bots, approval flows, document automation, and interactive messaging. It wraps the platform’s sprawling REST surface in a semantic, fully-typed client (client.im.message.create, client.contact.user.list, and hundreds more) so developers avoid hand-rolling token refresh, request signing, and pagination.

Beyond plain API calls, the SDK ships built-in event dispatching and card-action handling with adapters for Express, Koa, and generic HTTP, plus a WebSocket client for long-connection event delivery without exposing a public webhook endpoint. It is maintained directly by the Lark/Feishu team and tracks new platform capabilities closely, making it the default choice for any Node.js integration targeting the Lark/Feishu ecosystem.

What You Get

  • A semantic client (client.<domain>.<resource>.<method>) covering messaging, contacts, approvals, calendar, docs, and more with full TypeScript type hints
  • Automatic tenant/app access-token acquisition, caching, and refresh so callers never manage tokens manually
  • Built-in event dispatcher and interactive-card handlers with ready-made adapters for Express, Koa, and Koa-router
  • A WebSocket client (WSClient) for receiving platform events over a long connection instead of exposing a public webhook
  • Iterator-based pagination helpers (*WithIterator) that eliminate manual page_token bookkeeping
  • Encapsulated file upload/download handling, including streaming download via getReadableStream

Common Use Cases

  • Building a self-built or ISV Lark/Feishu bot that sends interactive message cards and responds to card actions
  • Automating enterprise workflows such as attendance, approvals, or contact/department management via server-side scripts
  • Receiving platform events (message, approval, calendar) through a WebSocket connection in environments without public inbound webhooks
  • Syncing organization contact/department data into an internal system using the paginated iterator APIs

Under The Hood

Architecture - The SDK centers on a Client class (client/client.ts) that extends a code-generated RequestTemplate base, giving every one of the hundreds of Feishu/Lark endpoints a typed method without hand-writing each one. A TokenManager handles app/tenant/user access-token acquisition, caching (pluggable Cache interface, defaulting to an in-memory store), and refresh transparently before each call. Separate modules handle concerns cleanly: dispatcher/ for event and card-action routing, adaptor/ for framework-specific HTTP glue (Express, Koa, Koa-router, or a generic default), and ws-client/ for a persistent WebSocket connection that receives platform events without a public webhook, using Protocol Buffers (ws-client/proto-buf) for the wire format.

Tech Stack - Written in TypeScript, built with Rollup into CommonJS and ESM outputs plus type declarations. Runtime dependencies are deliberately minimal: axios for HTTP, ws for the WebSocket client, protobufjs for binary event decoding, and small lodash.* helpers rather than the full lodash package. Dev tooling uses Jest for testing, ESLint (Airbnb base config) plus Prettier for style, and optional peer integrations with Express/Koa for the adapter layer.

Code Quality - The repo has 27+ __tests__ directories/files covering utilities, the channel/event layer, and logger internals, though core client request logic is comparatively thin on tests relative to its surface area. Code is organized by clear feature folders (client, dispatcher, adaptor, channel, ws-client) rather than one large file, naming is consistent with the domain model of the Feishu/Lark API, and TypeScript types are used throughout public interfaces, giving IDE-level safety for the very large generated API surface.

API Design - The semantic call pattern (client.im.message.create, client.contact.user.listWithIterator) closely mirrors the platform’s own documentation structure, which lowers the mental gap between reading Feishu’s API docs and writing code. Iterator-based pagination and encapsulated file upload/download remove common boilerplate, and the bilingual (English/Chinese) README plus linked official tutorials meaningfully shorten onboarding for a platform whose primary documentation is otherwise in Chinese.

Used by 5 apps in this directory

TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

33,179

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
85
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 95%
Updated 3 weeks ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

52,202

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
89
Repo Health
84
Technical
70
Dependency
Built with
TypeScript 99%
Updated 4 days ago
TypeScript
99%
Other

LobeHub

AI Assistants · Automation · Productivity

82,864

Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.

View details
92
Repo Health
81
Technical
66
Dependency
Built with
TypeScript 99%
Updated 4 days ago
TypeScript
92%
Apache 2.0

Apache Maka

AI Agents · AI Development · Developer Tools

5,668

An Apache-incubated agent workspace that treats every model call, tool run, and permission decision as an append-only, replayable event log instead of disposable chat history.

View details
81
Repo Health
85
Technical
81
Dependency
Built with
TypeScript 92%
Updated 4 days ago
TypeScript
91%
MIT

OpenClaw

AI Agents · AI Assistants

390,670

An open-source AI assistant that runs on your own hardware and meets you in Discord, Slack, WhatsApp, iMessage, Telegram, and 20+ other channels, with native apps for every major platform.

View details
88
Repo Health
88
Technical
68
Dependency
Built with
TypeScript 91%
Updated 4 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers