Skip to content

nuntly/nuntly-sdk-typescript-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nuntly TypeScript SDK Examples

This directory contains examples demonstrating how to use the Nuntly TypeScript SDK for various operations.

Setup

  1. Install dependencies:

    pnpm install
  2. Configure environment variables:

    cp .env.template .env

    Then edit .env and add your Nuntly API key and other required values.

  3. Run any example:

    pnpm <script-name>

Available Examples

Account

  • pnpm account:get - Retrieve account information

API Keys

  • pnpm api-keys:create - Create a new API key
  • pnpm api-keys:list - List all API keys
  • pnpm api-keys:get - Retrieve a specific API key
  • pnpm api-keys:delete - Delete an API key

Domains

  • pnpm domains:create - Create a new domain

Emails

  • pnpm emails:send - Send a basic email
  • pnpm emails:send-bulk - Send bulk emails
  • pnpm emails:send-bulk-with-fallback - Send bulk emails with fallback
  • pnpm emails:send-with-attachment - Send email with attachment
  • pnpm emails:send-with-tag - Send email with tags
  • pnpm emails:send-html - Send HTML email
  • pnpm emails:send-html-txt - Send email with both HTML and text
  • pnpm emails:send-template - Send email using a template

Webhooks

  • pnpm webhooks:create - Create a new webhook
  • pnpm webhooks:list - List all webhooks
  • pnpm webhooks:get - Retrieve a specific webhook
  • pnpm webhooks:update - Update a webhook
  • pnpm webhooks:delete - Delete a webhook

Organizations

  • pnpm organizations:get - Get organization details
  • pnpm organizations:list-memberships - List organization memberships
  • pnpm organizations:send-invitation - Send organization invitation
  • pnpm organizations:get-usage - Get organization usage statistics

Project Structure

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

Environment Variables

The examples use the following environment variables (configured in .env):

  • NUNTLY_API_KEY - Your Nuntly API key (required)
  • EMAIL_FROM - Default sender email address
  • EMAIL_TO - Default recipient email address

Usage Tips

  1. Start with basic examples like account:get to verify your API key is working
  2. Check the source code of each example to understand the parameters and options
  3. Modify the examples to fit your specific use case
  4. Use real IDs when testing examples that require specific resource IDs (webhooks, organizations, etc.)

Need Help?

Releases

Packages

Contributors

Languages