Usage

import Itzam from "itzam";

const itzam = new Itzam("YOUR_API_KEY");

const thread = await itzam.threads.create({
  workflowSlug: "customer-support",
  name: "Chat for user 123",
  lookupKey: "user-123",
});

console.log(thread.id); // Use this ID for subsequent messages

Parameters

ParameterTypeRequiredDescription
workflowSlugstringYesThe slug of the workflow this thread belongs to.
namestringNoThe name of the thread. Auto-generated if not provided.
lookupKeystringNoA custom lookup key for finding the thread later.

Return Value

type Thread = {
  id: string; // The unique thread ID
  name: string; // The thread name
  lookupKey: string | null; // The lookup key if provided
  createdAt: string; // ISO 8601 timestamp
  updatedAt: string; // ISO 8601 timestamp
};