npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ospgroupvn/lark-user-token

v1.1.0

Published

A CLI tool to get user access token from Lark/Feishu

Readme

Get User Access Token from Lark

Tool CLI to get user access token from Lark/Feishu.

Installation

From npm (recommended)

npm install -g lark-user-token

Testing

The project now includes comprehensive unit tests using Jest:

# Run tests
npm test

# Run tests with coverage
npm run test:ci

# Run tests in watch mode
npm run test:watch

From source code

git clone <repository-url>
cd src/get-user-access-token
npm install
npm run build

Usage (English)

Interactive Mode (Recommended for beginners)

# Run without any parameters for guided setup
lark-user-token

# Follow the prompts to choose your preferred command style and enter parameters

Command Line Mode

# Using short flags
lark-user-token --a YOUR_APP_ID --s YOUR_APP_SECRET --r CALLBACK_URL

# Using long flags (more descriptive)
lark-user-token --app-id YOUR_APP_ID --app-secret YOUR_APP_SECRET --redirect-uri CALLBACK_URL

# From source code
npx ts-node index.ts --a YOUR_APP_ID --s YOUR_APP_SECRET --r CALLBACK_URL

Parameters

  • --a (required): Lark App ID
  • --s (required): Lark App Secret
  • --r (optional): Callback URL, default is http://localhost:3000/callback

Notes

  • Callback URL must be configured in allowed redirect URLs at Lark Developer Console
  • The tool will automatically open a browser for authentication
  • After successful authentication, access token and refresh token will be displayed

Examples

Interactive Mode

# Start interactive mode
lark-user-token

# The tool will guide you through:
# 1. Choose command style (short or long flags)
# 2. Enter App ID
# 3. Enter App Secret  
# 4. Enter custom redirect URI (optional)
# 5. Confirm settings and proceed

Command Line Mode

# Using short flags with default callback URL
lark-user-token --a cli_a1234567890abcdef --s your_app_secret_here

# Using short flags with custom callback URL
lark-user-token --a cli_a1234567890abcdef --s your_app_secret_here --r https://your-domain.com/callback

# Using long flags (more descriptive)
lark-user-token --app-id cli_a1234567890abcdef --app-secret your_app_secret_here --redirect-uri https://your-domain.com/callback

Troubleshooting

  • If the browser does not open automatically, copy the URL shown in the terminal and open it manually
  • Ensure the callback URL is configured in the Lark Developer Console
  • Check that App ID and App Secret are correct

Lấy User Access Token từ Lark (Tiếng Việt)

Cách sử dụng

Chế độ tương tác (Khuyến nghị cho người mới)

# Chạy không cần tham số để được hướng dẫn từng bước
lark-user-token

# Làm theo hướng dẫn để chọn kiểu lệnh và nhập các tham số

Chế độ dòng lệnh

# Sử dụng flags ngắn
lark-user-token --a YOUR_APP_ID --s YOUR_APP_SECRET --r CALLBACK_URL

# Sử dụng flags dài (mô tả rõ ràng hơn)
lark-user-token --app-id YOUR_APP_ID --app-secret YOUR_APP_SECRET --redirect-uri CALLBACK_URL

# Sử dụng từ source code
npx ts-node index.ts --a YOUR_APP_ID --s YOUR_APP_SECRET --r CALLBACK_URL

Tham số

  • --a (bắt buộc): Lark App ID
  • --s (bắt buộc): Lark App Secret
  • --r (tùy chọn): Callback URL, mặc định là http://localhost:3000/callback

Lưu ý

  • Callback URL cần được cấu hình trong allowed redirect urls tại Lark Developer Console
  • Tool sẽ tự động mở trình duyệt để xác thực
  • Sau khi xác thực thành công, access token và refresh token sẽ được hiển thị

Ví dụ

Chế độ tương tác

# Khởi động chế độ tương tác
lark-user-token

# Tool sẽ hướng dẫn bạn qua các bước:
# 1. Chọn kiểu lệnh (flags ngắn hay dài)
# 2. Nhập App ID
# 3. Nhập App Secret
# 4. Nhập custom redirect URI (tùy chọn)
# 5. Xác nhận cài đặt và tiếp tục

Chế độ dòng lệnh

# Sử dụng flags ngắn với callback URL mặc định
lark-user-token --a cli_a1234567890abcdef --s your_app_secret_here

# Sử dụng flags ngắn với custom callback URL
lark-user-token --a cli_a1234567890abcdef --s your_app_secret_here --r https://your-domain.com/callback

# Sử dụng flags dài (mô tả rõ ràng hơn)
lark-user-token --app-id cli_a1234567890abcdef --app-secret your_app_secret_here --redirect-uri https://your-domain.com/callback

Troubleshooting

  • Nếu trình duyệt không tự động mở, hãy copy URL được hiển thị trong terminal và mở thủ công
  • Đảm bảo callback URL đã được cấu hình trong Lark Developer Console
  • Kiểm tra App ID và App Secret có chính xác không