Client-Side/Angular SDK

Client Setup

How to initialize the Angular SDK client and configure authentication

SDK Initialization

  1. Import the AudienceLabService in your Angular component or service.
  2. Inject the service via the constructor.
  3. Call initialize('YOUR_API_KEY') in your component's ngOnInit or service initialization logic.
constructor(private audienceLab: AudienceLabService) {}

async ngOnInit() {
  await this.audienceLab.initialize('YOUR_API_KEY');
}
  • The SDK will automatically fetch and cache a creative token.
  • Retention metrics are sent automatically (only once per day).

API Key

Automatic Features

  • Creative Token Management: Handled automatically (fetch, cache, include in all events).
  • Retention Events: Sent once per day, tracked via localStorage.

No additional configuration is required after initialization.