@earendil-works/mailhook
v0.1.2
Published
TypeScript SDK for the Mailhook API
Readme
@earendil-works/mailhook
TypeScript SDK for the Mailhook API.
Installation
npm install @earendil-works/mailhook
# or
pnpm add @earendil-works/mailhookUsage
import { Mailhook } from "@earendil-works/mailhook";
import { verifyAndParseWebhook } from "@earendil-works/mailhook/webhook";
const mailhook = new Mailhook({
apiKey: process.env.MAILHOOK_API_KEY!,
});
const domains = await mailhook.domains.list();
console.log(domains.items);
const event = verifyAndParseWebhook(
rawBody,
process.env.MAILHOOK_WEBHOOK_SECRET!,
undefined,
undefined,
undefined,
request.headers as Record<string, string>,
);Publishing
This package is published from sdks/typescript:
pnpm --filter @earendil-works/mailhook build
pnpm --filter @earendil-works/mailhook publish --access publicUse pnpm --filter @earendil-works/mailhook publish --dry-run to inspect the tarball before publishing.
