SDKv1.0.0

SnapAlert Documentation

Instantly send notifications when errors occur in your application.

Getting Started

SnapAlert is a robust error monitoring SDK that sends instant notifications via Email, SMS, and Call when errors occur in your application. This documentation will guide you through setting up and configuring SnapAlert in your project.

Note

You'll need to sign up for a SnapAlert account to get your API key before proceeding with the installation.

Installation

Install the SnapAlert SDK using npm, yarn, or pnpm:

npm
npm install snapalert
yarn
yarn add snapalert

Import and Initialize

After installing the SDK, you need to import and initialize it with your API key:


import snapalert from 'snapalert';
// Initialize with your API key snapalert.setApiKey('YOUR_API_KEY');

Configuration

Configure SnapAlert to match your project's requirements. You can specify which notification channels to use, set alert priorities, and customize other options.


snapalert.setConfig({
  errorThreshold: 5,
  intervalMinutes: 1
});
  

Configuration Options

OptionTypeDescription
notificationChannelsstring[]Array of channels to use: 'email', 'sms', 'call'
errorThresholdnumberNumber of errors before sending an alert
intervalMinutesnumberTime window in minutes to count errors

Error Reporting

Use alertOnError to automatically send notifications when errors occur in your application:


snapalert.alertOnError('Database connection failed.', {
  alertMethods: ['sms', 'call']
});

Error Reporting Parameters

ParameterTypeDescription
errorMsgstringA descriptive error message that will be sent as the alert notification.
optionsobject (optional)Configuration object for alert customization.
Supported property:
alertMethods (string[]): Specifies which notification channels to use for this error alert (e.g., ['sms', 'call']).
If omitted, the alert will use all default notification channels configured in your SnapAlert dashboard.

Note: Currently, alertMethods is the only supported property. Any other properties in this object will be ignored.

Pricing

SnapAlert offers different pricing tiers to match your project's needs:

Free

For individuals and small projects
$0
  • Email alerts only
  • Up to 100 alerts/month
  • Basic error dashboard
  • Community support
POPULAR

Pro

For teams and businesses
$49/mo
  • Email, SMS, and Call alerts
  • Unlimited alerts
  • Advanced analytics dashboard
  • Priority support

Enterprise Solutions

Need a custom solution?

Contact our sales team for tailored pricing and features for your organization.

Contact Sales

Frequently Asked Questions

Find answers to commonly asked questions about SnapAlert.

Can I use SMS alerts on the free tier?

No, the free tier only includes email alerts. You'll need to upgrade to our Pro plan to access SMS and phone call notifications.

How secure is my API key?

Treat your API key like a password. Keep it secret and store it in environment variables rather than hardcoding it in your application. If your API key is compromised, you can rotate it from your account dashboard.

How quickly are alerts sent?

Notifications are sent instantly upon receiving an error report. Critical alerts on the Pro tier receive highest priority routing to ensure minimal delay. Most notifications are delivered within seconds of the error occurring.

Can I use this with Node.js/Next.js?

Yes, SnapAlert is designed to work in any JavaScript/TypeScript environment, including Node.js, Next.js, React, Vue, and vanilla JS applications. We provide framework-specific integration guides in our examples section.

Can I customize the notification templates?

Yes, Pro tier users can customize notification templates for email, SMS, and calls. You can add your company branding, customize the layout, and include specific information in your alerts.

Still have questions?

Can't find the answer you're looking for? Please chat to our friendly team.