Feishu common

From autogame-17/feishu-skills · View interactive version

Feishu common is an AI agent skill from the GitHub repository autogame-17/feishu-skills. 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.

How to use this skill

Skill file

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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.