noketa
v1.3.2
Published
Node.js library for the Noketa API.
Readme
noketa
Official JavaScript/TypeScript SDK for the Noketa API.
Install
bun add noketaUsage
import { Noketa } from "noketa";
const client = new Noketa(process.env.NOKETA_API_KEY!);
await client.contacts.create({
email: "[email protected]",
attributes: {
first_name: "Jane",
last_name: "Doe",
},
});Creates or updates a contact by email (upsert). Optional subscribed and tags are applied only when inserting a new contact.
Track a custom event to start or resume automations:
await client.events.track({
event: "product.purchased",
email: "[email protected]",
metadata: {
orderId: "order_123",
},
});The profiles namespace is deprecated and forwards to contacts.
Send transactional email (open/click tracking is on by default; disable for password resets and similar). If your organization has an active branded tracking domain, Noketa uses it for tracking links automatically:
await client.emails.send({
from: "[email protected]",
to: "[email protected]",
subject: "Reset your password",
html: '<p><a href="https://app.example/reset">Reset password</a></p>',
tracking: false,
});By default the client uses https://api.noketa.io as the API origin (/api/v1/contacts, /api/v1/events, /api/v1/emails, …). Override with new Noketa(key, { baseUrl: "https://your-host" }) for local or alternate deployments.
