Official SDK for the Zyntra temporary email service.
Full SDK and API documentation is available at https://docs.zyntra.app
npm install zyntramail-api
- Sign up at https://app.zyntra.app
- Go to API Keys section and generate your API key
- Use this key when initializing
ZyntraClient
To interact with inboxes, you'll need your Team ID, which is part of every email address.
- Go to https://app.zyntra.app
- Look in the bottom-left corner of the sidebar
- Copy the Team ID using the clipboard icon
It will look like this:
f72c2547
You’ll use it in email addresses like:
f72c2547.signup-flow@zyntramail.com
You can set the following environment variables to simplify SDK usage:
-
ZYNTRA_API_KEY
: API key used for authentication. -
ZYNTRA_TEAM_ID
: Team ID used when generating email addresses.
These allow you to skip passing apiKey
and teamId
directly:
const client = new ZyntraClient(); // Uses env vars if defined
import { ZyntraClient } from 'zyntramail-api';
// API key and team ID can be loaded from env vars:
// ZYNTRA_API_KEY and ZYNTRA_TEAM_ID
const client = new ZyntraClient({
apiKey: 'your-api-key',
teamId: 'your-team-id'
});
// Generate a random inbox address based on your team ID
const inbox = client.generateEmail();
// Get the last email received at that inbox
// This method uses server-side long polling (up to ~30s),
// so retries are not needed
const lastEmail = await client.getLastEmail(inbox);
// Get list of emails in a mailbox
const emails = await client.getEmails('teamId.anytext@zyntramail.com');
// Get single email by UUID
const email = await client.getEmailById('messageUuid');
// Delete email by UUID
await client.deleteEmail('messageUuid');
// Get attachments for an email
const attachments = await client.getAttachments('messageUuid');
// Download a specific attachment
const file = await client.downloadAttachment('attachmentUuid');