Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

mailslurp-client

3.0.10 • Public • Published

Official MailSlurp Javascript/Typescript API Client

Offical SDK Client for the MailSlurp API. See about page for more information.

Completely rewritten for MailSlurp v2.0.

About

This client is a handwritten wrapper around the official generated swagger client. It's written in Typescript but can be used in Javascript.

MailSlurp Logo

Documentation

Please see official documentation for extensive usage and examples.

The source for this client is very small so try reading index.ts Typescript definitions. Or take a look at the js-docs.

Install

npm install mailslurp-client OR yarn add mailslurp-client

Usage

Instantiation

// import the package
import { MailSlurp } from "mailslurp-client"
// OR const MailSlurp = require("mailslurp-client").MailSlurp
 
// create an instance with your apiKey
const api = new MailSlurp({ apiKey: "test" })

Methods

interface AbstractMailSlurpClient {
    getMessage(messageId: string): Promise<Email>;
 
    createInbox(): Promise<Inbox>;
 
    deleteInbox(inboxId: string): Promise<Response>;
 
    getInbox(inboxId: string): Promise<Inbox>;
 
    getInboxes(): Promise<Inbox[]>;
 
    getMessages(inboxId: string, args: GetMessagesOptions = {}): Promise<EmailPreview[]>;
 
    sendMessage(inboxId: string, sendEmailOptions: SendEmailOptions): Promise<Response>
}
 

Response types

See documentation for more information.

Calling a method

// call methods and get a Promise back
(async () => {
    try {
        const inbox = await api.createInbox()
    } catch (e) {
        // handle error
    }
})

For all functions and operations see the typescript definitions.

Keywords

none

install

npm i mailslurp-client

Downloadsweekly downloads

134

version

3.0.10

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability