Feishu-skills feishu-common
Shared Feishu (Lark) authentication and API request helper providing tenant token acquisition with caching, automatic retry with timeout handling, and authenticated request wrappers with token refresh.
install
source · Clone the upstream repo
git clone https://github.com/autogame-17/feishu-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/autogame-17/feishu-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/feishu-common" ~/.claude/skills/autogame-17-feishu-skills-feishu-common && rm -rf "$T"
manifest:
feishu-common/SKILL.mdsource content
feishu-common
Shared authentication and API helper for all OpenClaw Feishu skills. Install this skill first -- every other
feishu-* skill depends on it.
Prerequisites
Set these environment variables before using any Feishu skill:
export FEISHU_APP_ID=cli_xxxxx export FEISHU_APP_SECRET=xxxxx
Usage
Import the shared helpers in any dependent skill:
const { getToken, fetchWithRetry, fetchWithAuth } = require("../feishu-common/index.js");
Workflow
- Authenticate --
acquires a tenant access token and caches it locally, refreshing automatically on expiry.getToken() - Make requests --
adds thefetchWithAuth(url, options)
header and handles token refresh on 401 responses.Authorization - Handle failures --
wraps fetch with configurable retry count and timeout.fetchWithRetry(url, options)
Compatibility Alias
A legacy import path is available for backward compatibility:
const { getToken, fetchWithAuth } = require("../feishu-common/feishu-client.js");
Files
-- Main implementation (token cache, retry logic, authenticated fetch).index.js
-- Compatibility alias that re-exports fromfeishu-client.js
.index.js