botmailroom
TypeScript icon, indicating that this package has built-in type declarations

0.0.12 • Public • Published

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
# or
yarn add botmailroom

3. Initialize the Client

import { BotMailRoom } from "botmailroom";

const client = new BotMailRoom("your_api_key"); // or set the BOTMAILROOM_API_KEY environment variable

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:

  1. Using a mail client of your choice.
  2. 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);

Package Sidebar

Install

npm i botmailroom

Weekly Downloads

22

Version

0.0.12

License

MIT

Unpacked Size

86.3 kB

Total Files

7

Last publish

Collaborators

  • itsskiseason