egomobile / node-api-messenger

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

Home Page:https://egomobile.github.io/node-api-messenger/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

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

https://egomobile.github.io/node-api-messenger/

License:GNU Lesser General Public License v3.0


Languages

Language:TypeScript 96.6%Language:JavaScript 3.4%