Options
All
  • Public
  • Public/Protected
  • All
Menu

@egomobile/api-messenger

npm last build PRs Welcome

@egomobile/api-messenger

A client using an API to send messages, like emails, written in TypeScript.

Install

Execute the following command from your project folder, where your package.json file is stored:

npm install --save @egomobile/api-messenger

Usage

import createApiMessenger from "@egomobile/api-messenger";

async function main() {
const messenger = createApiMessenger({
baseURL: "https://api.example.com/",
auth: {
clientId: "<YOUR-CLIENT-ID>",
clientSecret: "<YOUR-CLIENT-SECRET>",
},
});

const result = await messenger.sendMessages({
message: {
content: "PGI+TG9yZW0gaXNwdW0hPC9iPg==",
content_type: "text/html",
},
subject: "Lorem ipsum",
to: ["mailto:test2@example.com", "mailto:test2@example.com"],
});

console.log(result);
}

main().catch(console.error);

Documentation

The API documentation can be found here.

Generated using TypeDoc