Skip to content

sendblue-api/sendblue-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sendblue Node.js Library

Overview

This package is a Node.js wrapper for the Sendblue API. It provides a simple interface for sending and receiving messages.

Prerequisites

You will need to get API keys by signing up for a Sendblue account. You can do so here.

Installation

npm install sendblue

Usage

Initializing

import Sendblue from sendblue;

// Load your key from an environment variable or secret management service
// (do not include your key directly in your code)
SENDBLUE_API_KEY = process.env.SENDBLUE_API_KEY
SENDBLUE_API_SECRET = process.env.SENDBLUE_API_SECRET

sendblue = new Sendblue(SENDBLUE_API_KEY, SENDBLUE_API_SECRET)

Send Message

const response = await sendblue.sendMessage('+19998887777', 'Hello from Sendblue!', 'invisible', 'https://source.unsplash.com/random.png', 'https://example.com/callback');

Send Group Message

const response = await sendblue.sendGroupMessage(['+19998887777', '+19998887778'], 'Hello from Sendblue!', 'invisible', 'https://source.unsplash.com/random.png', 'https://example.com/callback');

Get Message

const response = await sendblue.getMessage('messageId');

Modify Group

const response = await sendblue.modifyGroup('groupId', 'add_recipient', '+19998887777');

Lookup Number

const response = await sendblue.lookup('+19998887777');

Send Typing Indicator

const response = await sendblue.sendTypingIndicator('+19998887777');

Get Contacts

const response = await sendblue.getContacts();

Create Contact

const response = await sendblue.createContact('+19998887777', 'First Name', 'Last Name', 'Company Name');

Delete Contact

const response = await sendblue.deleteContact('contactId');

Get Messages

const response = await sendblue.getMessages('contactId');

About

A node wrapper for the sendblue api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •