@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({ authenticationCode: "<AUTH_CODE>" });
async function run () {
const { messageId } = await courier.send({
eventId: "<EVENT_ID>",
recipientId: "<RECIPIENT_ID>",
profile: {},
data: {}
});
console.log(messageId);
const replaceRes = await courier.replaceProfile({
recipientId: "<PROFILE_ID>",
profile: {
email: "example@example.com"
}
});
console.log(replaceRes.status);
const mergeRes = await courier.mergeProfile({
recipientId: "<PROFILE_ID>",
profile: {
"sms": "555-555-5555"
}
});
console.log(mergeRes.status);
const { profile } = await courier.getProfile({
recipientId: "<PROFILE_ID>"
});
console.log(profile);
};
run();
License
MIT License
Author
Courier (support@trycourier.com)