@egomobile/api-messenger
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

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.

Package Sidebar

Install

npm i @egomobile/api-messenger

Weekly Downloads

0

Version

0.3.0

License

LGPL-3.0

Unpacked Size

24 kB

Total Files

12

Last publish

Collaborators

  • ekmobile
  • egodux
  • mkloubert
  • ekegodigital