Quickstart
Get Claude working in your application with a single TypeScript file.Prerequisites
- Node.js 18 or later
- A Chucky account (sign up free)
- Your Project ID and HMAC secret from project settings
1. Create Your Project
Create a new directory and install the SDK:2. Set Your Credentials
3. Create quickstart.ts
Create a file calledquickstart.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?
- Token creation - The
createToken()function generates a JWT that authenticates your user and sets their budget limits - Client connection -
ChuckyClientconnects to Chucky’s secure WebSocket endpoint - Prompt execution -
client.prompt()sends your message to Claude and returns the complete response - Result extraction -
getResultText()extracts the text response from the result object - 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