Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.paubox.com/llms.txt

Use this file to discover all available pages before exploring further.

1

Install the SDK

npm install --save paubox-node
2

Set your credentials

Create a .env file in your project root:
API_KEY=YOUR_API_KEY
API_USERNAME=YOUR_USERNAME
The SDK loads these automatically. To obtain credentials, see Authentication.
3

Send your first email

Create send.js:
const pbMail = require('paubox-node');

async function main() {
  const service = pbMail.emailService();

  const message = pbMail.message({
    from:         'sender@yourdomain.com',
    to:           ['recipient@example.com'],
    subject:      'Your first Paubox email',
    text_content: 'This message was sent with the Paubox Node.js SDK.'
  });

  const response = await service.sendMessage(message);
  console.log('Sent. Tracking ID:', response.sourceTrackingId);
}

main().catch(console.error);
Run it:
node send.js
Sent. Tracking ID: abc123-def456-...
4

Check delivery status

const disposition = await service.getEmailDisposition(response.sourceTrackingId);

for (const delivery of disposition.data.message.message_deliveries) {
  console.log(`${delivery.recipient}${delivery.status.deliveryStatus}`);
}
recipient@example.com → delivered

Next steps

  • Email client: bulk send, attachments, dynamic templates, error handling
  • Forms client: retrieve form schemas and submit responses