{"library":"notificationapi-node-server-sdk","title":"NotificationAPI Node.js Server SDK","description":"The NotificationAPI Node.js Server SDK provides a streamlined interface for integrating real-time and multi-channel notifications into server-side applications. This SDK allows developers to send various types of notifications, including in-app, email, SMS, and push notifications, by interacting with the NotificationAPI platform. Currently at version 2.8.0, the package appears to be actively maintained with frequent updates, indicated by its publishing history on npm. It abstracts the complexity of notification delivery, enabling developers to focus on application logic rather than the intricacies of different communication channels or provider APIs. The SDK ships with built-in TypeScript types, ensuring a robust development experience and improved code quality for TypeScript users. Key differentiators lie in the comprehensive notification platform it connects to, offering a centralized solution for notification management, templating, and delivery across multiple channels.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install notificationapi-node-server-sdk"],"cli":null},"imports":["import { NotificationAPI } from 'notificationapi-node-server-sdk';","import NotificationAPI from 'notificationapi-node-server-sdk';","import type { NotificationAPIClientConfig } from 'notificationapi-node-server-sdk';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { NotificationAPI } from 'notificationapi-node-server-sdk';\n\nconst CLIENT_ID = process.env.NOTIFICATIONAPI_CLIENT_ID ?? '';\nconst CLIENT_SECRET = process.env.NOTIFICATIONAPI_CLIENT_SECRET ?? '';\n\nif (!CLIENT_ID || !CLIENT_SECRET) {\n  console.error('Environment variables NOTIFICATIONAPI_CLIENT_ID and NOTIFICATIONAPI_CLIENT_SECRET must be set.');\n  process.exit(1);\n}\n\nconst notificationapi = new NotificationAPI({\n  clientId: CLIENT_ID,\n  clientSecret: CLIENT_SECRET,\n});\n\nasync function sendExampleNotification() {\n  try {\n    const response = await notificationapi.send({\n      notificationId: 'user_welcome',\n      user: {\n        id: 'test-user-123',\n        email: 'test@example.com',\n        // Additional user properties like 'name', 'phone_number' can be added\n      },\n      mergeTags: {\n        firstName: 'John',\n        lastName: 'Doe',\n        welcomeMessage: 'Welcome to our service!',\n      },\n    });\n    console.log('Notification sent successfully:', response);\n  } catch (error) {\n    console.error('Failed to send notification:', error);\n  }\n}\n\nsendExampleNotification();\n","lang":"typescript","description":"Demonstrates initializing the NotificationAPI SDK with environment variables and sending a basic welcome notification to a user with merge tags.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}