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:

FieldTypeDescription
first_namestring?Given name
last_namestring?Family name
localestring?Locale code (e.g. en, en-US)
genderstring?Gender
agenumber?Age
birthdateDate?Birth date
external_idstring?Your system’s user ID
last_event_dateDate?Last activity date
propertiesRecord<string, unknown>?Custom key-value data
[key: string]unknownAdditional 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.