@trycourier/courier
A node.js module for communicating with the Courier REST API.
Installation (via npm)
npm install @trycourier/courier
Usage
import CourierClient from "@trycourier/courier";
const courier = CourierClient({ authorizationToken: "<AUTH_TOKEN>" });
async function run () {
const { messageId } = await courier.send({
eventId: "<EVENT_ID>",
recipientId: "<RECIPIENT_ID>",
profile: {},
data: {}
});
console.log(messageId);
const { status: replaceStatus } = await courier.replaceProfile({
recipientId: "<RECIPIENT_ID>",
profile: {
"email": "example@example.com"
}
});
console.log(replaceStatus);
const { status: mergeStatus } = await courier.mergeProfile({
recipientId: "<RECIPIENT_ID>",
profile: {
"sms": "555-555-5555"
}
});
console.log(mergeStatus);
const { profile } = await courier.getProfile({
recipientId: "<RECIPIENT_ID>"
});
console.log(profile);
};
run();
License
MIT License
Author
Courier (support@trycourier.com)