@immail/web-api

0.0.11 • Public • Published

imMail Web API

The @immail/web-api lib contains an easy and customizable HTTP client for using Web API or on-premise versions. Use it in your app to call any of the endpoints.

Installation

$ npm install @immail/web-api

Usage

These example shows one of the most common features of the WebClient.


Initialize the client

The package exports a WebClient class. All you need to do is instantiate it, and you're ready to go. You'll typically initialize it with a { host }. If you do not provide a host, the default one (https://api.immail.ca) will be defined.

const { WebClient } = require('@immail/web-api');

// Read a host, login and password from the environment variables
const host = process.env.IMMAIL_API_HOST // Optional. Usefull for on-premise versions. The imMail's production host will be set as default
const login = process.env.IMMAIL_LOGIN
const password = process.env.IMMAIL_PASSWORD

// Initialize
const webImmail = new WebClient({ host })

// Login
await webImmail.login({ login, password })

Readme

Keywords

Package Sidebar

Install

npm i @immail/web-api

Weekly Downloads

3

Version

0.0.11

License

MIT

Unpacked Size

16.8 kB

Total Files

9

Last publish

Collaborators

  • rmsouza