Skip to main content

Build AI Experiences with Brand Intelligence

Generate AI responses powered by OpenAI with automatic brand enrichment and affiliate integration

Get Started in Minutes

Installation

Install the SDK with npm, yarn, or pnpm

Quickstart

Build your first AI-powered response in 5 minutes

Key Features

AI Response Generation

Leverage GPT-4, GPT-4 Turbo, and GPT-3.5 Turbo models for intelligent responses

Smart Brand Enrichment

Automatically enrich responses with relevant brand recommendations

Real-time Streaming

Stream responses in real-time with multiple consumption patterns

Affiliate Integration

Built-in tracking and impression registration for affiliate programs

Conversation Context

Maintain context across multiple interactions for natural conversations

TypeScript Support

Full TypeScript support with comprehensive type definitions

DOM Integration

Direct DOM manipulation for seamless web application integration

Error Handling

Robust error handling with specific error classes for different scenarios

Quick Example

import { ThredClient } from '@thred-apps/thred-js';

// Initialize the client
const client = new ThredClient({
  apiKey: process.env.THRED_API_KEY,
  defaultModel: 'gpt-4',
});

// Generate a response
const response = await client.answer({
  message: 'What are the best productivity tools?',
});

console.log(response.response);
// Brand information is automatically included
console.log(response.metadata.brandUsed?.name);

Explore the SDK

Streaming Responses

Learn how to use streaming for real-time responses

Conversation Context

Maintain context across multiple messages

Error Handling

Handle errors gracefully with typed error classes

API Reference

Client Configuration

Configure the ThredClient with all available options

Methods

Explore all available methods and their parameters

Types

Complete TypeScript type definitions

Error Types

All error classes and their properties

Need Help?

GitHub Issues

Report bugs or request features

View Source

Explore the source code on GitHub

Build docs developers (and LLMs) love