0.0.11 • Published 4 years ago

@immail/web-api v0.0.11

Weekly downloads
6
License
MIT
Repository
-
Last release
4 years ago

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 })
0.0.10

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

5 years ago

0.0.5

5 years ago

0.0.6

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago