Skip to content

yournotify/yournotify-node-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yournotify Node SDK

Current Node SDK for the Yournotify API.

Install

npm install yournotify-node-sdk

Usage

const Yournotify = require('yournotify-node-sdk');
const sdk = new Yournotify('your_api_key');

ESM:

import Yournotify from 'yournotify-node-sdk';
const sdk = new Yournotify('your_api_key');

Optional custom API base:

sdk.setApiUrl('https://api.yournotify.com/');

Supported methods

Campaigns

await sdk.sendEmail('Campaign', 'Subject', '<p>Hello</p>', 'Hello', 'draft', 'noreply@smtp.yournotify.net', [
  { email: 'person@example.com', name: 'Person' }
]);

await sdk.sendSMS('Campaign', 'YTAuth', 'Hello', 'draft', [
  { telephone: '+2348100000000', name: 'Person' }
]);

await sdk.getCampaign(123);
await sdk.getCampaigns('email', { page: 1 });
await sdk.updateCampaign(123, { name: 'Updated Campaign' });
await sdk.deleteCampaign(123);
await sdk.getCampaignStats(123, 'email');
await sdk.getCampaignReports(123, 'email');

Contacts

await sdk.addContact('person@example.com', '+2348100000000', 456, 'Person', { source: 'sdk' });
await sdk.getContact(789);
await sdk.getContacts({ page: 1 });
await sdk.updateContact(789, 'person@example.com', '+2348100000000', [456], 'Person', { source: 'sdk' });
await sdk.deleteContact(789);

Lists

await sdk.addList('Newsletter', 'public', 'single');
await sdk.getList(456);
await sdk.getLists({ page: 1 });
await sdk.updateList(456, 'Newsletter Updated');
await sdk.deleteList(456);

Profile

await sdk.getProfile();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors