Installation

Install the latest Inbound SDK using your preferred package manager:
npm install @inboundemail/sdk@latest

Requirements

  • Node.js 18.0 or later
  • TypeScript 4.5+ (for TypeScript projects)

Quick Start

1

Import the SDK

import { Inbound } from '@inboundemail/sdk'
2

Initialize with your API key (v3.0.0 syntax)

const inbound = new Inbound(process.env.INBOUND_API_KEY!)

// Optional: specify custom base URL
const inbound = new Inbound(
  process.env.INBOUND_API_KEY!,
  'https://custom.inbound.url/api/v2'
)
Breaking Change from v2.x: The constructor now takes the API key as a string parameter instead of a configuration object.
3

Send your first email

const email = await inbound.emails.send({
  from: 'hello@yourdomain.com',
  to: 'user@example.com',
  subject: 'Welcome!',
  html: '<p>Thanks for signing up!</p>',
  tags: [{ name: 'campaign', value: 'welcome' }]
})

console.log(`Email sent: ${email.id}`)

Migration from v2.x

If you’re upgrading from v2.x, here are the key changes:
// v2.x (OLD)
const inbound = new Inbound({
  apiKey: process.env.INBOUND_API_KEY!,
  baseUrl: 'https://custom.url',
  defaultReplyFrom: 'support@domain.com'
})

// v3.x (NEW)
const inbound = new Inbound(
  process.env.INBOUND_API_KEY!,
  'https://custom.url'  // optional
)

TypeScript Support

The SDK includes comprehensive TypeScript definitions. All request and response types are fully typed for excellent IDE support and type safety.
import type { 
  InboundWebhookPayload,
  InboundWebhookEmail,
  Webhook
} from '@inboundemail/sdk'

Next Steps