Skip to main content

Quickstart

Get Claude working in your application with a single TypeScript file.

Prerequisites

1. Create Your Project

Create a new directory and install the SDK:

2. Set Your Credentials

Get these from your project settings

3. Create quickstart.ts

Create a file called quickstart.ts:

4. Run It

Expected Output

Output below is representative. Actual Claude responses and timing will vary based on the model’s response.

What Just Happened?

  1. Token creation - The createToken() function generates a JWT that authenticates your user and sets their budget limits
  2. Client connection - ChuckyClient connects to Chucky’s secure WebSocket endpoint
  3. Prompt execution - client.prompt() sends your message to Claude and returns the complete response
  4. Result extraction - getResultText() extracts the text response from the result object
  5. Clean shutdown - client.close() properly closes the connection

Next Steps

Multi-turn Conversations

Build interactive chat experiences with session memory

Add Custom Tools

Let Claude interact with your APIs and services

Authentication Deep Dive

Understand tokens, budgets, and security

Other Languages

Python, Go, and PHP SDK documentation