Types & Interfaces (Browser SDK)
CruxstackConfig
interface CruxstackConfig {
clientId: string; // Required: Your client identifier
customerId?: string; // Optional: Customer identifier
customerName?: string; // Optional: Human-readable customer name
userId?: string; // Optional: User identifier; omit for anonymous
autoCapture?: boolean; // Optional (default: true)
debugLog?: boolean; // Optional (default: false)
}
clientId
: Unique identifier for your client (required)customerId
: Tenant/customer identifier (optional)customerName
: Human-readable customer name (optional)userId
: User identifier for session tracking (optional)autoCapture
: Enable automatic event capture (optional, default: true)debugLog
: Enable debug logging (optional, default: false)
Example Usage
import { init, cruxCustom, CruxstackConfig } from '@cruxstack/browser-sdk';
const config: CruxstackConfig = {
clientId: 'web_demo_client_001',
userId: 'user-8731',
autoCapture: true,
debugLog: false
};
init(config);
cruxCustom('test_event', { data: 'value' });