Official Node.js SDK to interact with the Botly AI chatbot API.
npm install botly-ai
---
axios under the hood
bash
npm install botly-ai
`
---
Usage
`js
const { Botly } = require('botly-ai');
Botly("What's the weather today?", "YOUR_BOTLY_API_KEY")
.then(response => {
console.log("Botly replied:", response);
})
.catch(error => {
console.error("Error calling Botly:", error.message);
});
`
> You must replace "YOUR_BOTLY_API_KEY" with a valid Botly API key.
---
Response Format
The Botly function returns a Promise that resolves to the chatbot's reply as a string:
`js
"Today looks sunny with a high of 28°C!"
`
In case of an error (e.g., invalid key, network failure), the Promise will reject with a descriptive error message.
---
API Reference
$3
| Param | Type | Required | Description |
| ----------- | -------- | -------- | ----------------------------------- |
| userInput | string | Yes | Message you want to send to the bot |
| apiKey | string` | Yes | Your Botly API key |