mailinator-client

Mailinator REST API client for JavaScript applications.

Usage no npm install needed!

<script type="module">
  import mailinatorClient from 'https://cdn.skypack.dev/mailinator-client';
</script>

README

Mailinator REST API client for JavaScript applications.

Uses Microsoft's typed-rest-client. All requests are async functions.

Usage example

Create MailinatorClient
const mailinatorClient: MailinatorClient = new MailinatorClient("yourApiKeyHere");
Get inbox from domain
const response: IRestResponse<Inbox> = await mailinatorClient.request(
            new GetInboxRequest("yourDomainNameHere")
        );
Get paginated messages from domain and inbox
const response: IRestResponse<Inbox> = await mailinatorClient.request(
            new GetInboxRequest("yourDomainNameHere", "yourInboxNameHere", 10, 20, Sort.DESC, true)
        );
Get message
const response: IRestResponse<Message> = await mailinatorClient.request(
            new GetMessageRequest("yourDomainNameHere", "yourInboxNameHere", "yourMessageIdHere")
        );

Build tests

  • npm test

By default, most of the tests are skipped.

Build with tests

Most of the tests require env variables with valid values. Visit tests source code and review EnabledIfEnvironmentVariable wrapped parts. The more env variables you set, the more tests are run.

Create index