SDK & API

Everything you need to integrate TicketForge into your application.

Quick Start

Install the SDK and create your first ticket in under 2 minutes.

$ bun add @ticketforge/sdk

Installation

The official TypeScript SDK — zero dependencies, native fetch, ESM-first.

bun / yarn
bun add @ticketforge/sdk
npm
npm install @ticketforge/sdk
TypeScript ESM Zero deps Node 18+

Initialize the Client

import { TicketForgeClient } from '@ticketforge/sdk';

const tf = new TicketForgeClient({
  apiKey: 'tf_your_api_key',
  baseUrl: '',
});

Examples

Common operations with the SDK.

POST Create a Ticket
const ticket = await tf.createTicket({
  subject: 'Cannot access billing portal',
  body: 'Getting a 403 error when clicking "Manage Subscription"...',
  senderEmail: 'jane@acme.com',
  senderName: 'Jane Smith',
  priority: 'p2_high',
});

console.log(ticket.id); // "tkt_abc123"
console.log(ticket.status); // "open"
GET Get a Ticket
const ticket = await tf.getTicket('tkt_abc123');

console.log(ticket.subject);
console.log(ticket.status);
console.log(ticket.messages);
POST Reply to a Ticket
await tf.addMessage('tkt_abc123', {
  body: 'We\'ve identified the issue and deployed a fix.',
  isInternal: false,
});
GET Search Knowledge Base
const results = await tf.searchArticles('billing portal');

for (const article of results) {
  console.log(article.title, article.slug);
}