https://github.com/xedi/libraries-js-mailtrap
API Wrapper for Mailtrap
https://github.com/xedi/libraries-js-mailtrap
api-wrapper js mailtrap
Last synced: about 1 year ago
JSON representation
API Wrapper for Mailtrap
- Host: GitHub
- URL: https://github.com/xedi/libraries-js-mailtrap
- Owner: xedi
- Created: 2019-08-28T13:08:42.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T14:38:43.000Z (over 3 years ago)
- Last Synced: 2025-03-20T14:10:58.074Z (over 1 year ago)
- Topics: api-wrapper, js, mailtrap
- Language: JavaScript
- Size: 692 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mailtrap API Wrapper
[](https://github.com/xedi/libraries-js-mailtrap/actions)
[](https://app.dependabot.com/accounts/xedi/repos/204934407)
## Installation
Install via NPM.
```shell
npm install --save @xedi/mailtrap
```
## Usage
```js
import Mailtrap from 'mailtrap';
// pass in your API Token
Mailtrap.setApiToken(process.env.MAILTRAP_API_TOKEN);
// You can also set a alternative URL for your Mailtrap service
// though this has a default of https://mailtrap.io
Mailtrap.setMailtrapUrl(process.env.MAILTRAP_URL);
// To access an inbox call it from the Mailtrap Facade.
const inbox = await Mailtrap.inbox(process.env.MY_INBOX_ID);
// You can also list all inboxes attached to the account
const inboxes = await Mailtrap.inboxes();
```
---
Made with 🤬 and 🍺 for @Jonny-webedi