Skip to content

Is keeping Pendo Api key in client-code secure? #104

Answered by yociduo
gambheera asked this question in Q&A
Discussion options

You must be logged in to vote
import {
  IPendoSettings,
  NGX_PENDO_SETTINGS_TOKEN,
  NGX_PENDO_WINDOW,
  NgxPendoModule,
  PendoWindow,
  pendoInitializer
} from 'ngx-pendo';

export function overridePendoInitializer(
  httpClient: HttpClient,
  $settings: IPendoSettings,
  window: PendoWindow
): () => Observable<void> {
  return () => {
    // You can use http client to make a api call
    return of('pendo-api-key').pipe(
      delay(1000),
      switchMap(pendoApiKey => from(pendoInitializer({ ...$settings, pendoApiKey }, window)()))
    );
  };
}

@NgModule({
  ...
  imports: [
    ...
    NgxPendoModule.forRoot({
      pendoApiKey: '', // leave it empty string, if have any value it will initialize pendo.
      p…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@yociduo
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by yociduo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants