Node SDK
The Node SDK makes it easy to integrate carbon credits into Node.js applications.
attention
The Node SDK requires Node v12+.
Installation
Install via npm:
npm install @cnaught/cnaught-node-sdk
Get Started
This short example illustrates how to use the SDK in your code
import { CNaughtApiClient } from '@cnaught/cnaught-node-sdk';
// Initialize your client with your CNaught API key
const apiKey = "Your API Key";
const client = new CNaughtApiClient(apiKey);
// place a ride order
const order = await client.submitRideOrder({ distanceKm: 10 });
/// check the details of the order using its id
const orderDetails = await client.getOrderDetails(order.id);