swu-logs
A small library for interacting with the SendWIthUs Logs API, complete with full TypeScript typings and async functions.
Installation
npm install swu-logs --save
If you're using TypeScript, the compiler should automatically pick up the package's typings (assuming you're on version 1.9+).
Usage
The library is exported with ES6's export default
syntax. To import it into your script, do the following:
//ES6-style import; //Node-style requireconst Client = default;
Then, initialize the client:
const client = apiKey
List logs
const logs = await client; // Or use promises client
Get a single logs
const log = await client; // Or use promisesclient
Get events for a log
const events = await client; // Or use promisesclient
Resend an email from a log
const result = await client; if resultsuccess ... // Or use promisesclient