@circle-fin/circle-sdk

中文文档
2.9.0发布于 2024/03/29Apache-2.0TypeScriptCommonJS近 30 天下载 2万

Node.js SDK for Circle API

原始使用文档
文档目录5 节
  1. Requirements
  2. Installation
  3. Usage
  4. Development
  5. Contributions

Circle APIs Node.js Library

npm version npm downloads

The Circle Node library provides convenient access to the Circle API for applications written in server-side JavaScript. For the API reference, see the Circle API docs.

Requirements

Node 10 or higher.

Installation

Install the package with:

npm install @circle-fin/circle-sdk --save
# or
yarn add @circle-fin/circle-sdk

Usage

In order to make API calls, you will need an API key. Once you obtain one, you can use this SDK to make API calls as follows:

import { Circle, CircleEnvironments, SubscriptionRequest } from "@circle-fin/circle-sdk";

// Initialize API driver
const circle = new Circle(
    '<your-api-key>',
    CircleEnvironments.sandbox      // API base url
);

async function createSubscription() {
    const subscribeReq: SubscriptionRequest = {
        endpoint: "https://example.org/handler/for/notifications"
    };

    const subscribeResp = await circle.subscriptions.createSubscription(subscribeReq);
    console.log(subscribeResp.data);
}
createSubscription();

Development

Clone this repo and install dependencies using

yarn install
  1. Run the codegen command to generate the source code for this SDK from the sdk.json OpenAPI specification file:

    yarn gen-sdk
    
  2. Run all tests:

    yarn test
    

Contributions

Please follow the Conventional Commits format for all commits when creating a contributing pull request for this repo.

版本与发布记录

@circle-fin/circle-sdk 共发布 29 个版本,首次发布于 2022/08/12;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.9.0latest2024/03/292 年前
2.8.02024/03/122 年前
2.7.12024/02/282 年前
2.7.02024/02/172 年前
2.6.22023/11/212 年前
2.6.12023/10/173 年前

其他发布通道:alpha → 0.1.0-alpha.0,beta → 0.1.1-beta.0。

关于 @circle-fin/circle-sdk 的常见问题

@circle-fin/circle-sdk 是什么?

Node.js SDK for Circle API

如何安装 @circle-fin/circle-sdk?

在项目目录运行 npm install @circle-fin/circle-sdk,或使用 pnpm add / yarn add / bun add。

@circle-fin/circle-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@circle-fin/circle-sdk 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@circle-fin/circle-sdk 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=10.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@circle-fin/circle-sdk 可以商用吗?

@circle-fin/circle-sdk 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@circle-fin/circle-sdk 的下载量有多少?

根据 npm 官方下载统计,@circle-fin/circle-sdk 在 2026/10/10 – 2026/11/08 这 30 天内被下载 20,169 次,日均约 672 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@circle-fin/circle-sdk 还在维护吗?

最新版本 2.9.0 发布于 2024/03/29(2 年前);至今共发布 29 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/08/12。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。