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

0.1.1 • Public • Published

zyntramail-api

Official SDK for the Zyntra temporary email service.

Documentation

Full SDK and API documentation is available at https://docs.zyntra.app

Installation

npm install zyntramail-api

Getting an API key

  1. Sign up at https://app.zyntra.app
  2. Go to API Keys section and generate your API key
  3. Use this key when initializing ZyntraClient

Getting your Team ID

To interact with inboxes, you'll need your Team ID, which is part of every email address.

📍 Where to find it:

  1. Go to https://app.zyntra.app
  2. Look in the bottom-left corner of the sidebar
  3. 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

Environment variables (optional)

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

Usage

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');

Package Sidebar

Install

npm i zyntramail-api

Weekly Downloads

2

Version

0.1.1

License

MIT

Unpacked Size

57.6 kB

Total Files

7

Last publish

Collaborators

  • zyntra.app