# @mailsac/api

> Official Mailsac API client library

Latest version **1.0.8** (published 2025-03-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mailsac/api
pnpm add @mailsac/api
yarn add @mailsac/api
bun add @mailsac/api
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2025-03-05 |
| First published | 2023-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 327 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Forking Software LLC |
| Maintainers | ruffrey |
| Keywords | mailsac, email, testing |

## Links

- npm: https://www.npmjs.com/package/@mailsac/api
- Repository: https://github.com/mailsac/mailsac-typescript-api
- Homepage: https://github.com/mailsac/mailsac-typescript-api#readme
- Issues: https://github.com/mailsac/mailsac-typescript-api/issues
- npm.io page: https://npm.io/package/@mailsac/api

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^1.6.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.8 (latest) — 2025-03-05
- 1.0.7 — 2024-12-19
- 1.0.6 — 2024-01-12
- 1.0.5 — 2023-12-06
- 1.0.4 — 2023-11-30
- 1.0.3 — 2023-11-01
- 1.0.2 — 2023-11-01
- 1.0.1 — 2023-11-01
- 0.1.2 — 2023-10-27
- 0.1.1 — 2023-10-27
- 0.1.0 — 2023-10-27

## README

# mailsac-typescript-api

Official Mailsac TypeScript and JavaScript Client Library

Compiled JavaScript files are published here, as well as TypeScript files and .d typings.

This library is generated from the openapi spec for mailsac
which can be seen at https://mailsac.com/openapi.yml or https://mailsac.com/openapi.json.

## Usage

```shell
npm install @mailsac/api
```

The official Mailsac API spec documentation which includes usage examples for this library:

https://mailsac.com/docs/api

or see the guides:

https://docs.mailsac.com

### [List of all mailsac client methods](methodList.md)

### Usage Example

Get started by instantiating a client library instance with an API key:

```typescript
import { Mailsac } from "@mailsac/api";
// or for javascript
// const { Mailsac } = require("@mailsac/api");

const mailsac = new Mailsac({ headers: {  "Mailsac-Key": process.env.MAILSAC_KEY } }); // api key from mailsac.com/v2/credentials
```

Then you can use the client to make requests:

```typescript
// list public messages on a public inbox (no need to create the inbox first!)
const messages = await mailsac.addresses.listMessages('test-public@mailsac.com');
console.log({ messages }); // [{...}, {...}, ...]

// reserve an enhanced private address - everybody starts with a free one.
const address = await mailsac.addresses.createAddress('test-private@mailsac.com');
console.log({ address }); // { _id: "test-private@mailsac-com", ... }
const myAddresses = await mailsac.addresses.list();
console.log({ myAddresses }); // [{ _id: "test-private@mailsac-com", ... }]

// got to your email client, send an email to the address....
// ...then check the mail
const messages = await mailsac.messages.listMessages('test-private@mailsac.com');
console.log({ messages }); // [{...}, {...}, ...]

```

There are many more API endpoints which are supported by the client library. Look at
`./mailsac-client.ts` under the `Mailsac` class to learn more.

Mailsac has features like custom subdomains of `msdc.co` which require no DNS config, so you can be receiving
private email for testing in seconds.

---
_Source: https://npm.io/package/@mailsac/api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
