Chargily Node.js SDK is a library for interacting with the Chargily API.
visit Chargily API Documentation for more information.
npm install chargily
# or
yarn add chargily
The package needs to be configured with your account's API key which is available in your Chargily Dashboard.
const Chargily = require("chargily");
const chargily = new Chargily("test_sk_..."); // your secret key
chargily.customers
.create({
email: "customer@example.com",
})
.then((customer) => console.log(customer.id))
.catch((error) => console.error(error));
or with ES6 import
import Chargily from "chargily";
const chargily = new Chargily("test_sk_..."); // your secret key
const customer = await chargily.customers.create({
email: "customer@example.com",
});
console.log(customer.id);