BotMailroom TypeScript Client
The BotMailroom TypeScript client allows you to interact with the BotMailroom API. It provides asynchronous methods for interacting with the API.
Quickstart
1. Get an API Key
You can get an API key by signing up for a BotMailroom account and creating an API key at https://auth.botmailroom.com/account/api_keys
2. Install the Client
npm install botmailroom
yarn add botmailroom
3. Initialize the Client
import { BotMailRoom } from "botmailroom";
const client = new BotMailRoom("your_api_key");
4. Create an Inbox
const inbox = await client.createInbox(
"My Inbox",
"CHANGE_THIS@inbox.botmailroom.com"
);
5. Check Emails
Unless you have specific allow and block rules that prevent it, you will receive an email from support@inbox.botmailroom.com
after you create an inbox for the first time. If you'd like to send a test email to your inbox, you can do so by:
- Using a mail client of your choice.
- Sending a request with the
sendEmail
method:
await client.sendEmail(inbox.id, "Test Email", "Hello from BotMailroom!", [
"recipient@example.com",
]);
You can then check for new emails using the getEmails
method:
const emails = await client.getEmails(true, inbox.id);
console.log(emails);