Package Exports
- @circle-fin/circle-sdk
- @circle-fin/circle-sdk/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@circle-fin/circle-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Circle APIs Node.js Library
The Circle Node library provides convenient access to the Circle API for applications written in server-side JavaScript.
Documentation
See the Circle API docs for Node.js.
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://742ef341af57c9.lhrtunnel.link"
};
const subscribeResp = await circle.subscriptions.subscribe(subscribeReq);
console.log(subscribeResp.data);
}
createSubscription();
Development
To run the codegen:
openapi-generator-cli generate -g typescript-axios \
-i sdk.json \
-o ./src/generated/ \
-p npmName=circle,supportsES6=true,modelPropertyNaming=original,apiPackage=apis,modelPackage=models \
-t ./templates/typescript-axios --additional-properties=npmVersion=0.1.0-alpha.0,circleApiVersion=v1,withSeparateModelsAndApi=true
Run all tests:
$ yarn install
$ yarn test