Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

notifications-node-client

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

notifications-node-client

GOV.UK Notify Node.js client

  • 5.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6M
decreased by-14.44%
Maintainers
1
Weekly downloads
 
Created

What is notifications-node-client?

The notifications-node-client is an npm package designed to interact with the GOV.UK Notify service, which allows you to send emails, text messages, and letters. This package provides a simple interface to integrate these notification services into your Node.js applications.

What are notifications-node-client's main functionalities?

Send Email

This feature allows you to send an email using a predefined template. You need to provide the template ID, recipient's email address, and any personalisation fields required by the template.

const NotifyClient = require('notifications-node-client').NotifyClient;
const notifyClient = new NotifyClient('your-api-key');

notifyClient.sendEmail('template-id', 'recipient@example.com', {
  personalisation: {
    name: 'John Doe',
    reference: '12345'
  },
  reference: 'your-reference'
}).then(response => console.log(response)).catch(err => console.error(err));

Send SMS

This feature allows you to send an SMS using a predefined template. You need to provide the template ID, recipient's phone number, and any personalisation fields required by the template.

const NotifyClient = require('notifications-node-client').NotifyClient;
const notifyClient = new NotifyClient('your-api-key');

notifyClient.sendSms('template-id', '07123456789', {
  personalisation: {
    name: 'John Doe',
    reference: '12345'
  },
  reference: 'your-reference'
}).then(response => console.log(response)).catch(err => console.error(err));

Send Letter

This feature allows you to send a letter using a predefined template. You need to provide the template ID and the recipient's address details.

const NotifyClient = require('notifications-node-client').NotifyClient;
const notifyClient = new NotifyClient('your-api-key');

notifyClient.sendLetter('template-id', {
  personalisation: {
    address_line_1: 'John Doe',
    address_line_2: '123 Main Street',
    postcode: 'AB1 2CD'
  },
  reference: 'your-reference'
}).then(response => console.log(response)).catch(err => console.error(err));

Other packages similar to notifications-node-client

FAQs

Package last updated on 27 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc