Quick Start Guide
Get started with Notify in minutes. This guide will walk you through setting up your account, creating your first API key, and sending your first email.
Installation
Install the Notify SDK using your preferred package manager:
# npm
npm install notifycx
# yarn
yarn add notifycx
# pnpm
pnpm add notifycx
Account Setup
Creating Your Account
First, you'll need to create an account and set up your company profile:
- Sign up at notify.cx/sign-up
- Verify your email address
- Complete your company profile setup
Setting Up Your API Key
Your API key is automatically generated when you create your account. To access it:
- Navigate to notify.cx/dashboard/credentials
- Copy your API key
- Store it securely in your environment variables:
NOTIFY_API_KEY=your_api_key_here
⚠️ Never expose your API key in client-side code or commit it to version control.
Sending Emails
You can send emails using three different methods:
Method 1: Using the SDK (Recommended)
Here's how to send your first email using the Notify SDK:
import Notify from "notifycx";
const notify = new Notify(process.env.NOTIFY_API_KEY);
async function sendEmail() {
try {
const response = await notify.sendEmail({
to: "recipient@example.com",
subject: "Hello world",
name: "John Doe",
message: "Your email content here",
});
if (response.error) {
console.error("Error sending email:", response.error);
return;
}
console.log("Email sent successfully:", response.data);
} catch (error) {
console.error("Failed to send email:", error);
}
}
Method 2: Using Direct API Calls
If you prefer not to use the SDK, you can make direct API calls using fetch:
async function sendEmailWithFetch() {
try {
const response = await fetch("https://notify.cx/api/send-email", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": process.env.NOTIFY_API_KEY,
},
body: JSON.stringify({
to: "recipient@example.com",
subject: "Hello world",
name: "John Doe",
message: "Your email content here",
}),
});
if (!response.ok) {
throw new Error(`Failed to send email: ${response.statusText}`);
}
const data = await response.json();
console.log("Email sent successfully:", data);
} catch (error) {
console.error("Failed to send email:", error);
}
}
Method 3: Using Email Templates (Recommended for Production)
Notify includes a powerful AI-powered template builder to help you create responsive email designs in minutes.
Learn more about Notify's email templates
For a better experience, use our template system:
- Create a template in the template builder
- Get your template ID from the templates dashboard
- Send an email using the template:
Using Templates with SDK:
async function sendTemplatedEmail() {
try {
const response = await notify.sendEmailFromTemplate({
to: "recipient@example.com",
from: "noreply@notify.cx",
templateId: "<your_template_id>",
variables: {
name: "John Doe",
company: "Example Inc.",
},
});
} catch (error) {
console.error("Failed to send template email:", error);
}
}
Using Templates with Direct API:
async function sendTemplateEmailWithFetch() {
try {
const response = await fetch(
"https://notify.cx/api/send-email-from-template",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": process.env.NOTIFY_API_KEY,
},
body: JSON.stringify({
to: "recipient@example.com",
from: "noreply@notify.cx",
templateId: "<your_template_id>",
variables: {
name: "John Doe",
company: "Example Inc.",
},
}),
}
);
if (!response.ok) {
throw new Error(`Failed to send template email: ${response.statusText}`);
}
const data = await response.json();
console.log("Template email sent successfully:", data);
} catch (error) {
console.error("Failed to send template email:", error);
}
}
Rate Limits
Before sending emails in production, be aware of these rate limits:
- Trial accounts: Up to 100 emails total (10/hour limit)
- To increase limits: Verify your domain here. Read this for more information.
- Learn more about Notify's Usage Limits and Quotas
What's Next?
To get the most out of Notify, familiarize yourself with these core concepts:
Email Templates
Create beautiful, responsive email templates using our AI-powered template builder. Templates allow you to maintain consistent branding while easily personalizing content for each recipient. Learn more about email templates →
Authentication and API Keys
Understand how authentication works in Notify, how to generate and manage API keys, and best practices for keeping your account secure. Learn more about authentication and API keys →
Email API Endpoints
Explore the various API endpoints available for sending emails, managing templates, and tracking delivery status. Learn more about email API endpoints →
Domain Verification
Improve deliverability and sender reputation by verifying your domain with Notify. Learn more about domain verification →
How To's
Ready to dive deeper? Check out these platform-specific guides:
- Learn how to use Notify with Node.js
- Learn how to use Notify with JavaScript
- Learn how to use Notify with React/Next.js