Creating the Client
Create a client instance with your datasources and pipes:Configuration Options
The client uses environment variables for configuration:Querying Endpoints
Query your endpoints with full type safety:Basic Query
Type-Safe Parameters
TypeScript validates your parameters:Typed Results
Query results are fully typed:Data Ingestion
Ingest data into datasources with type safety:Single Row Ingestion
Batch Ingestion
Ingest multiple rows at once:Datasource Operations
The client provides several operations for managing datasource data:Append from URL
Import data from a remote file:Replace from URL
Replace all rows with data from a file:Delete Rows
Delete rows matching a condition:Truncate
Remove all rows from a datasource:Complete Examples
Next.js API Route
Query data in a Next.js API route:Event Tracking
Ingest events from your application:React Hook
Fetch analytics in a React component:Batch Processing
Process and ingest large datasets:Error Handling
Handle errors gracefully:Best Practices
Handle BigInt properly
Remember that
uint64 and int64 types map to JavaScript bigint. Convert to numbers when needed:Next Steps
JWT Tokens
Create secure, scoped tokens for client-side use
Next.js Integration
Set up the SDK in your Next.js project