The Circle Node library provides convenient access to the Circle API for applications written in server-side JavaScript.
See the Circle API docs for Node.js.
Node 10 or higher.
Install the package with:
npm install @circle-fin/circle-sdk --save
# or
yarn add @circle-fin/circle-sdk
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://742ef341af57c9.lhrtunnel.link"
};
const subscribeResp = await circle.subscriptions.subscribe(subscribeReq);
console.log(subscribeResp.data);
}
createSubscription();
Clone this repo and install dependencies using
yarn install
-
Run the codegen:
yarn gen-sdk <sdk-version> # e.g. yarn gen-sdk 0.1.1-beta.0
-
Run all tests:
yarn test
Please follow the Conventional Commits format for all commits when creating a contributing pull request for this repo.