Appearance
TypeScript SDK
Welcome to the Synthetic Users TypeScript/JavaScript SDK documentation.
Overview
The TypeScript SDK provides a type-safe way to interact with the Synthetic Users API from your TypeScript and JavaScript applications.
Features
- Full TypeScript support with type definitions
- Works in Node.js and browser environments
- Promise-based API
- Tree-shakeable for smaller bundle sizes
- Automatic retries and rate limiting
Quick Links
Common Tasks
Quick access to the most frequently used SDK methods.
🚀 Getting Started
Essential methods to begin your research:
- createStudyV1 - Create a new research study
- createAudienceV1 - Define a target audience segment
- generateAudienceV1 - Auto-generate synthetic users with AI
🔬 Running Research
Conduct interviews and gather insights:
- interviewV1 - Run interviews with synthetic users
- studyFollowUpV1 - Ask follow-up questions on studies
- interviewFollowUpV1 - Follow up on specific interviews
📊 Generating Insights
Analyze data and extract patterns:
- generateSummaryV1 - Generate AI-powered insights summary
- generateKnowledgeGraphV1 - Create visual relationship graphs
- exportSummaryV1 - Export summaries to files
📄 Reports & Export
Create professional documents:
- createReportV1 - Create standalone research reports
- generateFullReportV1 - Generate complete report content
- getStudyPdfV1 - Download study as PDF
📁 File Management
Upload context and monitor progress:
- createFileV1 - Upload context documents
- uploadFileProxyV1 - Upload file content
- streamEventsV1 - Real-time progress via SSE
Requirements
- Node.js 16 or higher
- TypeScript 4.5 or higher (for TypeScript projects)
Authentication
The Synthetic Users API uses Bearer token authentication (HTTPBearer). You need to provide a valid access token when making API requests.
typescript
import { createConfiguration, Configuration } from '@syntheticusers/sdk'
const configuration: Configuration = createConfiguration({
baseServer: 'https://api.syntheticusers.com',
authMethods: {
HTTPBearer: {
tokenProvider: {
getToken: () => 'your-access-token'
}
}
}
})For more details, see the Authentication Guide.