Skip to main content
The SDK is framework-agnostic — in Angular, wrap it in a root-provided service so configuration happens once and components stay free of SDK plumbing.

Install

npm install @encorekit/web-sdk

A root-provided service

// encore.service.ts
import { Injectable } from '@angular/core';
import Encore from '@encorekit/web-sdk';
import { environment } from '../environments/environment';

@Injectable({ providedIn: 'root' })
export class EncoreService {
  constructor() {
    Encore.configure({ apiKey: environment.encoreApiKey });
  }

  identify(userId: string): void {
    Encore.identify(userId); // replaces the auto-generated anonymous UUID
  }

  show(placementId) {
    return Encore.placement(placementId).show(); // never rejects — branch on result.status
  }
}
Full configuration options: configure().

Present offers from a component

export class CancelComponent {
  constructor(private encore: EncoreService) {}

  async onCancelClicked() {
    const result = await this.encore.show('cancel_flow');
    if (result.status !== 'claimed') {
      this.proceedWithCancellation(); // 'dismissed' or 'unavailable' — continue your flow
    }
  }
}

Next steps