Skip to main content

Requirements

Before installing Thred SDK, ensure your environment meets these requirements:

Node.js

  • Node.js 16.0.0 or higher is required
  • For Node.js versions below 18, you’ll need a fetch polyfill (see below)

Browser Support

Thred SDK uses modern JavaScript features and requires:
  • Chrome 80+
  • Firefox 75+
  • Safari 13.1+
  • Edge 80+
The SDK requires the following browser APIs:
  • ES2020+
  • Fetch API
  • ReadableStream
  • TextDecoder
  • AbortController

Install the Package

Install the Thred SDK using your preferred package manager:
npm install @thred-apps/thred-js

Get Your API Key

To use Thred SDK, you’ll need an API key:
  1. Visit https://thred.ai and create an account
  2. Navigate to your dashboard
  3. Generate a new API key
  4. Copy your API key (it should start with sk_)
Keep your API key secure! Never commit it to version control or expose it in client-side code.

Environment Setup

Store your API key in an environment variable for security:
THRED_API_KEY=sk_your_api_key_here

Node.js < 18 Setup

If you’re using Node.js version 17 or below, you’ll need to install and configure a fetch polyfill:
npm install node-fetch
Node.js 18+ includes a native fetch implementation, so no polyfill is needed.

Verify Installation

Create a simple test file to verify your installation:
test.ts
import { ThredClient } from '@thred-apps/thred-js';

const client = new ThredClient({
  apiKey: process.env.THRED_API_KEY!,
});

console.log('Thred SDK initialized successfully!');
Run it:
node test.ts
If you see “Thred SDK initialized successfully!” without errors, you’re ready to go!

TypeScript Configuration

Thred SDK is written in TypeScript and includes full type definitions. No additional setup is required, but ensure your tsconfig.json includes:
tsconfig.json
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "lib": ["ES2020", "DOM"],
    "moduleResolution": "node",
    "esModuleInterop": true
  }
}

Next Steps

Now that you have Thred SDK installed, let’s generate your first AI response!

Quickstart Guide

Generate your first AI-powered response with brand enrichment in under 5 minutes

Build docs developers (and LLMs) love