@butlerbot/sdk
v0.0.17
Published
The official ButlerBot SDK
Downloads
1,902
Maintainers
Readme
ButlerBot SDK
ButlerBot SDK is a JavaScript library that provides a simple way to interact with the ButlerBot API.
Quickstart
Grab an API key at ButlerBot and install the package:
npm i @butlerbot/sdkNOTE: API key is currently not available on the ButlerBot UI
Prerequisites
- ButlerBot API key
Example
import { ButlerBotClient } from "@butlerbot/sdk";
const client = new ButlerBotClient({
apiKey: "your_api_key_here",
});
const convo = client.createConversation();
convo.send("Hey there Alfred!", (res) => {
if (!res.success) return;
const { type, payload } = res.data.response;
console.log(type, payload); // message { message: "Good day", ... }
});