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.md
source 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

  1. Authenticate --
    getToken()
    acquires a tenant access token and caches it locally, refreshing automatically on expiry.
  2. Make requests --
    fetchWithAuth(url, options)
    adds the
    Authorization
    header and handles token refresh on 401 responses.
  3. Handle failures --
    fetchWithRetry(url, options)
    wraps fetch with configurable retry count and timeout.

Compatibility Alias

A legacy import path is available for backward compatibility:

const { getToken, fetchWithAuth } = require("../feishu-common/feishu-client.js");

Files

  • index.js
    -- Main implementation (token cache, retry logic, authenticated fetch).
  • feishu-client.js
    -- Compatibility alias that re-exports from
    index.js
    .