SDK Initialization and Configuration
Learn how to initialize and configure the VocaFuse SDK for your application.
Basic Setup
import { VocaFuseSDK } from '@vocafuse/frontend-sdk';
const sdk = new VocaFuseSDK({
tokenEndpoint: '/api/vocafuse-token',
// apiBaseUrl is optional; defaults to https://api.vocafuse.com
// apiBaseUrl: 'https://api.vocafuse.com',
timeout: 30000,
retries: 3,
debug: false
});
await sdk.init();
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
tokenEndpoint | string | Required | Your backend endpoint that generates short-lived JWT tokens |
apiBaseUrl | string | https://api.vocafuse.com | VocaFuse API base URL (override if needed) |
timeout | number | 30000 | Request timeout in milliseconds |
retries | number | 3 | Number of retry attempts |
debug | boolean | false | Enable debug logging |