// 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
}
}