This TypeScript SDK provides a convenient wrapper for the Callchimp API, allowing developers to easily integrate Callchimp's functionalities into their TypeScript or JavaScript applications.
The generated Node module can be used in the following environments:
Environment
- Node.js
- Webpack
- Browserify
Language level
- ES5 - you must have a Promises/A+ library installed
- ES6
Module system
- CommonJS
- ES6 module system
It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via package.json
. (Reference)
Install the package using npm:
# using npm
npm install @dynopii/callchimp
# using pnpm
pnpm add @dynopii/callchimp
# using yarn
yarn add @dynopii/callchimp
To build and compile the typescript sources to javascript use:
npm install
npm run build
First, import the necessary modules and configure the SDK with your API key:
import { CampaignsApi, Configuration } from '@dynopii/callchimp';
const config = new Configuration({
basePath: "https://api.callchimp.ai/v1",
apiKey: "YOUR_API_KEY"
});
const campaignsApi = new CampaignsApi(config);
To list all campaigns:
async function listCampaigns() {
try {
const campaigns = await campaignsApi.campaignsList();
console.log(campaigns);
} catch (error) {
console.error('Error fetching campaigns:', error);
}
}
listCampaigns();
For detailed API documentation and more examples, visit Callchimp API Documentation.
This SDK is released under the MIT License.