New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

postfleet

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postfleet

TypeScript SDK for Postfleet — email infrastructure for AI agents.

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
4
-77.78%
Maintainers
1
Weekly downloads
 
Created
Source

postfleet

TypeScript SDK for Postfleet — email infrastructure for AI agents.

Install

npm install postfleet

Node 18+ (global fetch). A pf_ API key from https://postfleet.ai.

Quickstart

import { Postfleet } from 'postfleet';

const pf = new Postfleet({ apiKey: process.env.POSTFLEET_API_KEY! });

const box = await pf.mailboxes.create({ display_name: 'Support agent' });

const incoming = await pf.messages.waitFor({ mailbox_id: box.id });
if (!incoming) throw new Error('timed out waiting for mail');

// Read body_clean: the sanitized text. body_raw is the pre-sanitization original,
// kept for audit — the exact surface the screening pipeline stripped.
console.log(incoming.body_clean);

await pf.messages.send({
  mailbox_id: box.id,
  reply_to_message_id: incoming.id,
  text: 'Got it — working on this now.',
  client_id: 'reply-1',
});

Errors

Failed requests throw PostfleetError (status, optional code / retryable, and the parsed body). A network failure is status: 0 and retryable: true.

import { Postfleet, PostfleetError } from 'postfleet';

try {
  await pf.messages.send({ mailbox_id, to, subject, text, client_id });
} catch (err) {
  if (err instanceof PostfleetError && err.retryable) {
    // retry with the SAME client_id
  }
  throw err;
}

Idempotency

client_id is optional and the SDK never mints one. Generate a client_id once per logical send and reuse it on retry; never mint a new one per attempt. A fresh key on retry is exactly the double-send the key prevents.

Docs

Keywords

postfleet

FAQs

Package last updated on 08 Sep 2026

Related posts