@inboxical/sdk
v0.1.0
Published
Inboxical Test Inbox API — Node.js SDK. Create disposable email inboxes for automated testing.
Maintainers
Readme
@inboxical/sdk
Official Node.js SDK for Inboxical — disposable email inboxes for automated testing.
Test signup flows, OTP verification, password resets, and transactional emails in your CI/CD pipelines.
Install
npm install @inboxical/sdkQuick Start
import { Inboxical } from "@inboxical/sdk";
const client = new Inboxical({ apiKey: "mk_test_xxx" });
// Create a disposable inbox
const inbox = await client.createInbox({ name: "signup-test" });
console.log(inbox.email_address); // [email protected]
// ... trigger your app to send an email ...
// Wait for the email to arrive (long-polling)
const message = await client.waitForMessage(inbox.id, { timeout: 30 });
console.log(message.subject); // "Verify your email"
// Extract OTP/verification code automatically
const code = client.extractCode(message);
console.log(code); // "847291"
// Clean up
await client.deleteInbox(inbox.id);API
new Inboxical(options)
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| apiKey | string | required | Your API key (mk_...) |
| baseUrl | string | https://api.inboxical.com | API base URL |
| timeout | number | 30000 | Request timeout (ms) |
Inbox Methods
createInbox(options?)— Create a new test inboxlistInboxes(options?)— List inboxes with paginationgetInbox(inboxId)— Get inbox by IDdeleteInbox(inboxId)— Delete inbox and all messages
Message Methods
getMessages(inboxId, options?)— List messages with paginationgetLatestMessage(inboxId)— Get the most recent messagewaitForMessage(inboxId, options?)— Long-poll until a message arrivesgetMessage(messageId)— Get message by IDdeleteMessage(messageId)— Delete a message
Helpers
extractCode(message, options?)— Extract OTP/verification code from message body
Integration Packages
@inboxical/cypress— Cypress commands@inboxical/playwright— Playwright fixtures
Documentation
Full API docs and guides at inboxical.com/docs
License
MIT
