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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lark-anycross/integration

v0.3.2

Published

AnyCross Integration SDK for Node.js

Readme

@lark-anycross/integration

轻量封装连接器调用能力,提供 IntegrationClient

初始化参数说明

new IntegrationClient(opts) 的参数 opts 支持以下配置:

  • apiKey?: string
    • 用于鉴权;默认从 process.env.LARK_INTEGRATION_API_KEY 读取
  • baseUrl?: string
    • 平台基础域名;默认从 process.env.LARK_INTEGRATION_BASE_URL 读取,回退为 https://anycross.feishu.cn/
  • headers?: Record<string, string> | Headers | [string, string][]
    • 额外请求头;默认 {}
  • debug?: boolean
    • 是否开启调试日志;默认取 process.env.LARK_INTEGRATION_DEBUG === 'true'
  • timeoutMs?: number
    • 请求超时时间(毫秒);默认 60000,最小需大于 0
  • logger?: { info; error; warning; warn? }
    • 自定义日志器;默认使用 globalThis.logger(如存在)或 console

示例:

import { IntegrationClient } from '@lark-anycross/integration'

const client = new IntegrationClient({
  apiKey: 'YOUR_API_KEY',
  baseUrl: 'https://anycross.feishu.cn/',
  headers: { 'X-Custom-Header': 'demo' },
  debug: false,
  timeoutMs: 30000,
})

const { output } = await client.connector.crm({
  version: '1.0',
  action: 'syncLead',
  connectionID: 'conn_xxx',
  input: { id: '123' },
})

通过环境变量配置初始化

支持通过环境变量注入初始化信息,无需在代码中显式传入。

可用环境变量:

  • LARK_INTEGRATION_API_KEY:用于请求鉴权
  • LARK_INTEGRATION_BASE_URL:平台基础域名,可选配置,默认 https://anycross.feishu.cn/
  • LARK_INTEGRATION_DEBUG:是否开启 Debug 日志(值为字符串 'true' 时开启),可选配置

示例(使用 .env 或 shell 环境):

# .env 或 shell 中设置
LARK_INTEGRATION_API_KEY=sk_xxx
LARK_INTEGRATION_BASE_URL=https://anycross.feishu.cn/
LARK_INTEGRATION_DEBUG=true

代码中直接从环境变量读取:

import 'dotenv/config'
import { IntegrationClient } from '@lark-anycross/integration'

// 显式参数缺省时,将自动读取对应环境变量
const client = new IntegrationClient()

const { output } = await client.connector.crm({
  version: '1.0',
  action: 'syncLead',
})

优先级说明:显式传入的 opts 参数优先于环境变量。

Debug 模式说明

当开启 Debug 模式(debug: true 或设置环境变量 LARK_INTEGRATION_DEBUG=true)时,SDK 会打印调用请求与响应的详细日志,便于排查问题:

  • 请求日志:包含 urlmethodheadersAuthorization 将被遮蔽)与 body 预览
  • 响应日志:包含 statusokdatalogID(来自响应头 x-tt-logid

可选自定义日志器:

const logger = {
  info: (msg: string, payload?: unknown) => console.info(msg, payload),
  error: (msg: string, payload?: unknown) => console.error(msg, payload),
  warning: (msg: string, payload?: unknown) => console.warn(msg, payload),
}

const client = new IntegrationClient({ debug: true, logger })

注意:Debug 日志较为详细,建议在本地开发或问题定位时开启,生产环境谨慎使用。