NotifkitClient is a thin, typed wrapper over the REST API. Each method makes one request and returns the response body.
Setup
import { NotifkitClient } from "notifkit";
const notifkit = new NotifkitClient({
baseUrl: "https://notify.example.com",
apiKey: process.env.NOTIFKIT_API_KEY, // sent as Authorization: Bearer
headers: { "x-project-id": "…" }, // optional, added to every request
templates: [/* … */], // optional, pushed by sync()
});
With the admin key, set x-project-id in headers for project routes. A 204 resolves to undefined. Any other non-2xx throws an Error whose message is the body's message, else its error, else Request failed with status <code>. Validation errors therefore surface as "validation_error": read the issues with a direct request if you need them. There's no built-in retry.