This directory contains examples demonstrating how to use the Nuntly TypeScript SDK for various operations.
-
Install dependencies:
pnpm install
-
Configure environment variables:
cp .env.template .env
Then edit
.envand add your Nuntly API key and other required values. -
Run any example:
pnpm <script-name>
pnpm account:get- Retrieve account information
pnpm api-keys:create- Create a new API keypnpm api-keys:list- List all API keyspnpm api-keys:get- Retrieve a specific API keypnpm api-keys:delete- Delete an API key
pnpm domains:create- Create a new domain
pnpm emails:send- Send a basic emailpnpm emails:send-bulk- Send bulk emailspnpm emails:send-bulk-with-fallback- Send bulk emails with fallbackpnpm emails:send-with-attachment- Send email with attachmentpnpm emails:send-with-tag- Send email with tagspnpm emails:send-html- Send HTML emailpnpm emails:send-html-txt- Send email with both HTML and textpnpm emails:send-template- Send email using a template
pnpm webhooks:create- Create a new webhookpnpm webhooks:list- List all webhookspnpm webhooks:get- Retrieve a specific webhookpnpm webhooks:update- Update a webhookpnpm webhooks:delete- Delete a webhook
pnpm organizations:get- Get organization detailspnpm organizations:list-memberships- List organization membershipspnpm organizations:send-invitation- Send organization invitationpnpm organizations:get-usage- Get organization usage statistics
examples/
├── src/
│ ├── account/ # Account-related examples
│ ├── api-keys/ # API key management examples
│ ├── domains/ # Domain management examples
│ ├── emails/ # Email sending examples
│ ├── organizations/ # Organization management examples
│ ├── webhooks/ # Webhook management examples
│ ├── env.ts # Environment variable configuration
│ └── nuntly.ts # Shared Nuntly client instance
├── .env # Your environment variables (not in git)
├── .env.template # Template for environment variables
└── package.json # Project configuration and scripts
The examples use the following environment variables (configured in .env):
NUNTLY_API_KEY- Your Nuntly API key (required)EMAIL_FROM- Default sender email addressEMAIL_TO- Default recipient email address
- Start with basic examples like
account:getto verify your API key is working - Check the source code of each example to understand the parameters and options
- Modify the examples to fit your specific use case
- Use real IDs when testing examples that require specific resource IDs (webhooks, organizations, etc.)
- Check the Nuntly API Documentation
- Look at the TypeScript types for parameter definitions