Types
TypeScript types exported from the noketa package
The noketa package exports the client and all request/response types from the root module. Use them for type-safe requests and responses.
Exports
import {
Noketa,
type ContactAttributes,
type CreateContactRequest,
type CreateContactResponse,
type NoketaApiResponse,
type SendEmailRequest,
type SendEmailResponse,
} from "noketa";Legacy names ProfileAttributes, CreateProfileRequest, and CreateProfileResponse are still exported for compatibility; prefer the Contact* types.
ContactAttributes
Used in Contacts for attributes. Supports known optional fields and arbitrary custom keys:
| Field | Type | Description |
|---|---|---|
first_name | string? | Given name |
last_name | string? | Family name |
locale | string? | Locale code (e.g. en, en-US) |
gender | string? | Gender |
age | number? | Age |
birthdate | Date? | Birth date |
external_id | string? | Your system’s user ID |
last_event_date | Date? | Last activity date |
properties | Record<string, unknown>? | Custom key-value data |
[key: string] | unknown | Additional custom fields |
API responses
CreateContactResponse is the typed shape returned by contacts.create:
type CreateContactResponse = {
message: string;
contactId: string;
action?: "created" | "updated";
};SendEmailResponse uses the broader NoketaApiResponse:
type NoketaApiResponse = {
message?: string;
[key: string]: unknown;
};Use NoketaApiResponse when you need to access extra fields returned by the API.