ngx-pendo 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -110,8 +110,7 @@ import { NgxPendoService } from 'ngx-pendo';
110
110
  @Component( ... )
111
111
  export class AppComponent implements OnInit {
112
112
 
113
- constructor(private ngxPendoService: NgxPendoService) {
114
- }
113
+ private ngxPendoService = inject(NgxPendoService);
115
114
 
116
115
  ngOnInit() {
117
116
  this.ngxPendoService.initialize({
@@ -132,13 +131,12 @@ export class AppComponent implements OnInit {
132
131
 
133
132
  ```ts
134
133
  import { Component, OnInit } from '@angular/core';
135
- import { NGX_PENDO_CONTEXT, IPendo } from 'ngx-pendo';
134
+ import { NGX_PENDO_CONTEXT } from 'ngx-pendo';
136
135
 
137
136
  @Component( ... )
138
137
  export class AppComponent implements OnInit {
139
138
 
140
- constructor(@Inject(NGX_PENDO_CONTEXT) private pendo: IPendo) {
141
- }
139
+ private pendo = inject(NGX_PENDO_CONTEXT);
142
140
 
143
141
  ngOnInit() {
144
142
  this.pendo.initialize({
@@ -1,5 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, DOCUMENT, Injectable, input, signal, computed, Directive, contentChildren, effect, APP_INITIALIZER, isDevMode, NgModule, makeEnvironmentProviders } from '@angular/core';
2
+ import { InjectionToken, inject, Injectable, input, signal, computed, Directive, contentChildren, effect, APP_INITIALIZER, isDevMode, NgModule, makeEnvironmentProviders } from '@angular/core';
3
+ import { DOCUMENT } from '@angular/common';
3
4
  import { interval } from 'rxjs';
4
5
 
5
6
  const NGX_PENDO_SETTINGS_TOKEN = new InjectionToken('ngx-pendo-settings', {
@@ -22,13 +23,9 @@ const NGX_PENDO_CONTEXT = new InjectionToken('ngx-pendo-context', {
22
23
  });
23
24
 
24
25
  class NgxPendoService {
25
- /**
26
- * Constructor
27
- */
28
26
  constructor() {
29
27
  this.pendo = inject(NGX_PENDO_CONTEXT);
30
- const settings = inject(NGX_PENDO_SETTINGS_TOKEN);
31
- this.pendoIdFormatter = settings.pendoIdFormatter;
28
+ this.pendoIdFormatter = inject(NGX_PENDO_SETTINGS_TOKEN).pendoIdFormatter;
32
29
  }
33
30
  initialize(optionsOrVisitor, account) {
34
31
  if ('id' in optionsOrVisitor) {
@@ -94,6 +91,12 @@ class NgxPendoService {
94
91
  disableDebugging() {
95
92
  this.pendo?.disableDebugging();
96
93
  }
94
+ /**
95
+ * Method to manually track events. Requires a non-empty name string to collect event.
96
+ */
97
+ track(trackType, metadata) {
98
+ this.pendo?.track(trackType, metadata);
99
+ }
97
100
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NgxPendoService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
98
101
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NgxPendoService, providedIn: 'root' }); }
99
102
  }
@@ -102,7 +105,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
102
105
  args: [{
103
106
  providedIn: 'root'
104
107
  }]
105
- }], ctorParameters: () => [] });
108
+ }] });
106
109
 
107
110
  class NgxPendoIdDirective {
108
111
  constructor() {
@@ -212,7 +215,6 @@ function pendoInitializer($settings, window) {
212
215
  }
213
216
 
214
217
  /* eslint-disable @typescript-eslint/no-explicit-any */
215
- /* eslint-disable @typescript-eslint/no-empty-object-type */
216
218
  /* eslint-disable @typescript-eslint/no-unsafe-function-type */
217
219
 
218
220
  class NgxPendoModule {
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-pendo.mjs","sources":["../../../projects/ngx-pendo/src/lib/ngx-pendo.tokens.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.service.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo-id.directive.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo-section.directive.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.injectors.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.interfaces.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.module.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.provide.ts","../../../projects/ngx-pendo/src/public-api.ts","../../../projects/ngx-pendo/src/ngx-pendo.ts"],"sourcesContent":["import { InjectionToken, inject, DOCUMENT } from '@angular/core';\nimport { PendoWindow } from './ngx-pendo.types';\nimport { IPendo, IPendoSettings } from './ngx-pendo.interfaces';\n\nexport const NGX_PENDO_SETTINGS_TOKEN = new InjectionToken<IPendoSettings>('ngx-pendo-settings', {\n providedIn: 'root',\n factory: () => ({ pendoApiKey: '' })\n});\n\nexport const NGX_PENDO_WINDOW = new InjectionToken<PendoWindow>('ngx-pendo-window', {\n providedIn: 'root',\n factory: () => {\n const { defaultView } = inject(DOCUMENT);\n\n if (!defaultView) {\n throw new Error('Window is not available');\n }\n\n return defaultView;\n }\n});\n\nexport const NGX_PENDO_CONTEXT = new InjectionToken<IPendo>('ngx-pendo-context', {\n providedIn: 'root',\n factory: () => inject(NGX_PENDO_WINDOW).pendo!\n});\n","import { Injectable, inject } from '@angular/core';\nimport { NGX_PENDO_CONTEXT, NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\nimport { IAccount, IPendoOptions, IVisitor } from './ngx-pendo.interfaces';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NgxPendoService {\n private pendoIdFormatter?: (pendoId: string) => string;\n\n private pendo = inject(NGX_PENDO_CONTEXT);\n\n /**\n * Constructor\n */\n constructor() {\n const settings = inject(NGX_PENDO_SETTINGS_TOKEN);\n this.pendoIdFormatter = settings.pendoIdFormatter;\n }\n\n /**\n * Completely re-initialize the Agent with new options\n *\n * @param optionsOrVisitor IPendoOptions | IVisitor\n * @param account IAccount\n */\n initialize(options: IPendoOptions): void;\n initialize(visitor: IVisitor, account?: IAccount): void;\n initialize(optionsOrVisitor: IPendoOptions | IVisitor, account?: IAccount): void {\n if ('id' in optionsOrVisitor) {\n this.pendo?.initialize({ visitor: optionsOrVisitor, account });\n } else {\n this.pendo?.initialize(optionsOrVisitor);\n }\n }\n\n /**\n * Send an identify event and a meta event.\n *\n * @param visitor IVisitor | string\n * @param account IAccount | string\n */\n identify(visitor: string, account?: string): void;\n identify(visitor: IVisitor, account?: IAccount): void;\n identify(visitor: IVisitor | string, account?: IAccount | string): void {\n if (typeof visitor === 'string' && (!account || typeof account === 'string')) {\n this.pendo?.identify(visitor, account);\n } else {\n this.pendo?.identify({ visitor: visitor as IVisitor, account: account as IAccount });\n }\n }\n\n /**\n * Updates metadata object for the Pendo agent.\n *\n * @param options IPendoOptions\n */\n updateOptions(options: IPendoOptions): void {\n this.pendo?.updateOptions(options);\n }\n\n /**\n * Format Pendo\n *\n * @param ids string[]\n */\n formatPendoId(...ids: string[]): string {\n return (this.pendoIdFormatter ? ids.map(id => this.pendoIdFormatter!(id)) : ids).join('.');\n }\n\n /**\n * Shuts down the agent and cleans up all timers and listeners.\n */\n teardown(): void {\n this.pendo?.teardown();\n }\n\n /**\n * Checks if a given visitor id string is anonymous.\n * If no argument is given, calls with pendo.getVisitorId() to check current visitor status.\n */\n isAnonymousVisitor(visitorId?: string): boolean {\n return this.pendo?.isAnonymousVisitor(visitorId);\n }\n\n /**\n * Removes current visitor id and account id.\n * Triggers an identify event and reloads with a new anonymous visitor.\n */\n clearSession(): void {\n this.pendo?.clearSession();\n }\n\n /**\n * Loads Pendo Debugger and extends the global pendo object with additional functionality for debugging purposes.\n */\n enableDebugging(): void {\n this.pendo?.enableDebugging();\n }\n\n /**\n * Removes Pendo Debugger extension.\n */\n disableDebugging(): void {\n this.pendo?.disableDebugging();\n }\n}\n","import { Directive, inject, input, computed, signal } from '@angular/core';\nimport { IPendoDirective } from './ngx-pendo.interfaces';\nimport { NgxPendoService } from './ngx-pendo.service';\nimport { NgxPendoSectionDirective } from './ngx-pendo-section.directive';\n\n@Directive({\n selector: '[ngx-pendo-id]',\n standalone: true,\n host: {\n '[attr.data-pendo-id]': 'mergedPendoId()',\n '[attr.ngx-pendo-disable-inherit]': 'disableInherit()'\n }\n})\nexport class NgxPendoIdDirective implements IPendoDirective {\n pendoId = input<string>('', { alias: 'ngx-pendo-id' });\n\n inherit = input<boolean>(true, { alias: 'ngx-pendo-inherit' });\n\n parent = signal<NgxPendoSectionDirective | undefined>(undefined);\n\n mergedPendoId = computed<string>(() => {\n const pendoSections = [];\n\n let cur = this.inherit() ? this.parent() : null;\n while (cur) {\n pendoSections.unshift(cur.pendoSection());\n cur = cur.inherit() ? cur.parent() : null;\n }\n\n return this.service.formatPendoId(...pendoSections, this.pendoId());\n });\n\n disableInherit = computed<boolean | undefined>(() => (this.inherit() ? undefined : true));\n\n service = inject(NgxPendoService);\n}\n","import { Directive, input, computed, signal, contentChildren, effect } from '@angular/core';\nimport { IPendoDirective } from './ngx-pendo.interfaces';\nimport { NgxPendoIdDirective } from './ngx-pendo-id.directive';\n\n@Directive({\n selector: '[ngx-pendo-section]',\n standalone: true,\n host: {\n '[attr.data-pendo-section]': 'pendoSection()',\n '[attr.ngx-pendo-disable-inherit]': 'disableInherit()'\n }\n})\nexport class NgxPendoSectionDirective implements IPendoDirective {\n pendoSection = input<string>('', { alias: 'ngx-pendo-section' });\n\n inherit = input<boolean>(true, { alias: 'ngx-pendo-inherit' });\n\n parent = signal<NgxPendoSectionDirective | undefined>(undefined);\n\n idDirectives = contentChildren(NgxPendoIdDirective, { descendants: false });\n\n sectionDirectivs = contentChildren(NgxPendoSectionDirective, { descendants: false });\n\n disableInherit = computed<boolean | undefined>(() => (this.inherit() ? undefined : true));\n\n constructor() {\n effect(() => {\n [...this.idDirectives(), ...this.sectionDirectivs()].forEach(item => {\n if (item !== this) {\n item.parent.set(this);\n }\n });\n });\n }\n}\n","import { APP_INITIALIZER, isDevMode, Provider } from '@angular/core';\nimport { interval } from 'rxjs';\nimport { IPendoSettings } from './ngx-pendo.interfaces';\nimport { NGX_PENDO_WINDOW, NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\nimport { PendoWindow } from './ngx-pendo.types';\n\nconst DEFAULT_PENDO_SCRIPT_ORIGIN = 'https://cdn.pendo.io';\n\n// export const NGX_PENDO_INITIALIZER_PROVIDER = provideAppInitializer(() => {\n// const initializerFn = pendoInitializer(inject(NGX_PENDO_SETTINGS_TOKEN), inject(NGX_PENDO_WINDOW));\n// return initializerFn();\n// });\n\n// Keep the `APP_INITIALIZER` to support angular 17 and 18 version\nexport const NGX_PENDO_INITIALIZER_PROVIDER: Provider = {\n provide: APP_INITIALIZER,\n multi: true,\n useFactory: pendoInitializer,\n deps: [NGX_PENDO_SETTINGS_TOKEN, NGX_PENDO_WINDOW]\n};\n\nexport function pendoInitializer($settings: IPendoSettings, window: PendoWindow): () => Promise<void> {\n return async () => {\n const { pendoApiKey, pendoScriptOrigin } = $settings;\n if (!pendoApiKey) {\n if (isDevMode()) {\n console.error('Empty api key for Pendo. Make sure to provide one when initializing NgxPendoModule.');\n }\n\n return;\n }\n\n await new Promise<void>(resolve => {\n const script = document.createElement('script');\n script.async = true;\n script.src = `${pendoScriptOrigin || DEFAULT_PENDO_SCRIPT_ORIGIN}/agent/static/${pendoApiKey}/pendo.js`;\n document.head.appendChild(script);\n script.onerror = async () => {\n // The script may have been blocked by an ad blocker\n console.error('The pendo script may have been blocked.');\n resolve();\n };\n script.onload = async () => {\n // when enableDebugging should load extra js\n const sub = interval(100).subscribe(() => {\n if (window.pendo) {\n sub.unsubscribe();\n resolve();\n }\n });\n };\n });\n };\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-empty-object-type */\n/* eslint-disable @typescript-eslint/no-unsafe-function-type */\n\nimport { InputSignal, WritableSignal, Provider } from '@angular/core';\n\nexport interface IPendoSettings {\n pendoApiKey: string;\n pendoScriptOrigin?: string;\n pendoIdFormatter?: (pendoId: string) => string;\n pendoInitializerProvider?: Provider;\n}\n\nexport interface IPendoDirective {\n inherit: InputSignal<boolean>;\n parent: WritableSignal<IPendoDirective | undefined>;\n}\n\nexport interface IVisitor {\n id: string;\n [key: string]: string;\n}\n\nexport interface IAccount {\n id: string;\n [key: string]: string;\n}\n\nexport interface IPendoOptions {\n visitor?: IVisitor;\n account?: IAccount;\n // Core\n additionalApiKeys?: string[];\n annotateUrl?: Function;\n apiKey?: string;\n appAutoOrdering?: string[];\n autoFrameInstall?: boolean;\n contentHost?: string;\n cookieDomain?: string;\n dataHost?: string;\n disableCookies?: boolean;\n disableFeedback?: boolean;\n disablePendo?: boolean;\n disablePersistence?: boolean;\n frameIdentitySync?: boolean;\n ignoreHashRouting?: boolean;\n initializeImmediately?: boolean;\n observeShadowRoots?: boolean;\n leaderKey?: string[];\n localStorageOnly?: boolean;\n preferBroadcastChannel?: boolean;\n preferMutationObserver?: boolean;\n preventUnloadListener?: boolean;\n queryStringWhitelist?: string[] | Function;\n sanitizeUrl?: Function;\n selfHostedAgentUrl?: string;\n sendEventsWithPostOnly?: boolean;\n // Analytics\n allowedText?: string[];\n analytics?: {\n excludeEvents?: string[];\n };\n enableDebugEvents?: boolean;\n eventPropertyMatchParents?: boolean;\n excludeAllText?: boolean;\n excludeNonGuideAnalytics?: boolean;\n syntheticClicks?: {\n elementRemoval?: boolean;\n targetChanged?: boolean;\n };\n // Guides\n disableGlobalCSS?: boolean;\n disableGuidePseudoStyles?: boolean;\n disablePrefetch?: boolean;\n enableDesignerKeyboardShortcut?: boolean;\n enableGuideTimeout?: boolean;\n guideSeenTimeoutLength?: number;\n guideValidation?: boolean;\n guides?: {\n attachPoint?: string | Function;\n delay?: boolean;\n disabled?: boolean;\n globalScripts?: any[];\n timeout?: number;\n tooltip?: {\n arrowSize?: number;\n };\n };\n preventCodeInjection?: boolean;\n}\n\nexport interface ISerializedMetadata {}\n\nexport interface IPendo {\n // Agent\n additionalApiKeys: string[];\n apiKey: string;\n getVersion: () => string;\n initialize: (options: IPendoOptions) => void;\n isReady: () => boolean;\n teardown: () => void;\n\n // Classic Guides\n hideLauncher: () => void;\n removeLauncher: () => void;\n showLauncher: () => void;\n toggleLauncher: () => void;\n\n // TODO: DOM\n\n // TODO: DOMQuery\n\n // Debugging\n addDebuggingFunctions: () => void;\n disableDebugging: () => void;\n disableLogging: () => void;\n enableDebugging: () => void;\n enableLogging: () => void;\n isDebuggingEnabled: () => void;\n logPublic: () => void;\n\n // TODO: Events\n\n // TODO: Guides\n\n // Identity\n clearSession: () => void;\n generate_unique_id: (prefix?: string) => string;\n getAccountId: () => string | null;\n get_account_id: () => string | null;\n getSerializedMetadata: () => ISerializedMetadata;\n getVisitorId: () => string;\n get_visitor_id: () => string;\n identify: (options: Pick<IPendoOptions, 'visitor' | 'account'> | string, accountId?: string) => void;\n isAnonymousVisitor: (visitorId?: string) => boolean;\n set_account_id: (newAccountId?: string) => void;\n set_visitor_id: (newVisitorId?: string) => void;\n updateOptions: (options: IPendoOptions) => void;\n\n // URL\n url: {\n get: () => string;\n };\n normalizedUrl: string;\n getCurrentUrl: () => string;\n getNormalizedUrl: () => string;\n pageLoad: (url: string) => void;\n\n // TODO: Utility\n\n // TODO: Validation\n}\n","import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { NgxPendoIdDirective } from './ngx-pendo-id.directive';\nimport { NgxPendoSectionDirective } from './ngx-pendo-section.directive';\nimport { NGX_PENDO_INITIALIZER_PROVIDER } from './ngx-pendo.injectors';\nimport { IPendoSettings } from './ngx-pendo.interfaces';\nimport { NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\n\n@NgModule({\n imports: [NgxPendoIdDirective, NgxPendoSectionDirective],\n exports: [NgxPendoIdDirective, NgxPendoSectionDirective]\n})\nexport class NgxPendoModule {\n static forRoot(settings: IPendoSettings): ModuleWithProviders<NgxPendoModule> {\n return {\n ngModule: NgxPendoModule,\n providers: [\n {\n provide: NGX_PENDO_SETTINGS_TOKEN,\n useValue: settings\n },\n settings.pendoInitializerProvider || NGX_PENDO_INITIALIZER_PROVIDER\n ]\n };\n }\n\n static forChild(): ModuleWithProviders<NgxPendoModule> {\n return {\n ngModule: NgxPendoModule\n };\n }\n}\n","import { makeEnvironmentProviders } from '@angular/core';\nimport { NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\nimport { NGX_PENDO_INITIALIZER_PROVIDER } from './ngx-pendo.injectors';\nimport { IPendoSettings } from './ngx-pendo.interfaces';\n\nexport function provideNgxPendo(settings: IPendoSettings) {\n return makeEnvironmentProviders([\n {\n provide: NGX_PENDO_SETTINGS_TOKEN,\n useValue: settings\n },\n settings.pendoInitializerProvider || NGX_PENDO_INITIALIZER_PROVIDER\n ]);\n}\n","/*\n * Public API Surface of ngx-pendo\n */\n\nexport * from './lib/ngx-pendo-id.directive';\nexport * from './lib/ngx-pendo-section.directive';\nexport * from './lib/ngx-pendo.service';\nexport * from './lib/ngx-pendo.injectors';\nexport * from './lib/ngx-pendo.interfaces';\nexport * from './lib/ngx-pendo.module';\nexport * from './lib/ngx-pendo.provide';\nexport * from './lib/ngx-pendo.tokens';\nexport * from './lib/ngx-pendo.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAIa,wBAAwB,GAAG,IAAI,cAAc,CAAiB,oBAAoB,EAAE;AAC/F,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE;AACpC,CAAA;MAEY,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB,EAAE;AAClF,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAK;QACZ,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC;QAExC,IAAI,CAAC,WAAW,EAAE;AAChB,YAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;;AAG5C,QAAA,OAAO,WAAW;;AAErB,CAAA;MAEY,iBAAiB,GAAG,IAAI,cAAc,CAAS,mBAAmB,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E,wBAAwB;AACjC,oBAAA,QAAQ,EAAE;AACX,iBAAA;gBACD,QAAQ,CAAC,wBAAwB,IAAI;AACtC;SACF;;AAGH,IAAA,OAAO,QAAQ,GAAA;QACb,OAAO;AACL,YAAA,QAAQ,EAAE;SACX;;8GAjBQ,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAd,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAHf,mBAAmB,EAAE,wBAAwB,CAC7C,EAAA,OAAA,EAAA,CAAA,mBAAmB,EAAE,wBAAwB,CAAA,EAAA,CAAA,CAAA;+GAE5C,cAAc,EAAA,CAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,mBAAmB,EAAE,wBAAwB,CAAC;AACxD,oBAAA,OAAO,EAAE,CAAC,mBAAmB,EAAE,wBAAwB;AACxD,iBAAA;;;ACLK,SAAU,eAAe,CAAC,QAAwB,EAAA;AACtD,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA;AACE,YAAA,OAAO,EAAE,wBAAwB;AACjC,YAAA,QAAQ,EAAE;AACX,SAAA;QACD,QAAQ,CAAC,wBAAwB,IAAI;AACtC,KAAA,CAAC;AACJ;;ACbA;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-pendo.mjs","sources":["../../../projects/ngx-pendo/src/lib/ngx-pendo.tokens.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.service.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo-id.directive.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo-section.directive.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.injectors.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.interfaces.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.module.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.provide.ts","../../../projects/ngx-pendo/src/public-api.ts","../../../projects/ngx-pendo/src/ngx-pendo.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { PendoWindow } from './ngx-pendo.types';\nimport { IPendo, IPendoSettings } from './ngx-pendo.interfaces';\n\nexport const NGX_PENDO_SETTINGS_TOKEN = new InjectionToken<IPendoSettings>('ngx-pendo-settings', {\n providedIn: 'root',\n factory: () => ({ pendoApiKey: '' })\n});\n\nexport const NGX_PENDO_WINDOW = new InjectionToken<PendoWindow>('ngx-pendo-window', {\n providedIn: 'root',\n factory: () => {\n const { defaultView } = inject(DOCUMENT);\n\n if (!defaultView) {\n throw new Error('Window is not available');\n }\n\n return defaultView;\n }\n});\n\nexport const NGX_PENDO_CONTEXT = new InjectionToken<IPendo>('ngx-pendo-context', {\n providedIn: 'root',\n factory: () => inject(NGX_PENDO_WINDOW).pendo!\n});\n","import { Injectable, inject } from '@angular/core';\nimport { NGX_PENDO_CONTEXT, NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\nimport { IAccount, IPendoOptions, IVisitor } from './ngx-pendo.interfaces';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NgxPendoService {\n private pendo = inject(NGX_PENDO_CONTEXT);\n private pendoIdFormatter = inject(NGX_PENDO_SETTINGS_TOKEN).pendoIdFormatter;\n\n /**\n * Completely re-initialize the Agent with new options\n *\n * @param optionsOrVisitor IPendoOptions | IVisitor\n * @param account IAccount\n */\n initialize(options: IPendoOptions): void;\n initialize(visitor: IVisitor, account?: IAccount): void;\n initialize(optionsOrVisitor: IPendoOptions | IVisitor, account?: IAccount): void {\n if ('id' in optionsOrVisitor) {\n this.pendo?.initialize({ visitor: optionsOrVisitor, account });\n } else {\n this.pendo?.initialize(optionsOrVisitor);\n }\n }\n\n /**\n * Send an identify event and a meta event.\n *\n * @param visitor IVisitor | string\n * @param account IAccount | string\n */\n identify(visitor: string, account?: string): void;\n identify(visitor: IVisitor, account?: IAccount): void;\n identify(visitor: IVisitor | string, account?: IAccount | string): void {\n if (typeof visitor === 'string' && (!account || typeof account === 'string')) {\n this.pendo?.identify(visitor, account);\n } else {\n this.pendo?.identify({ visitor: visitor as IVisitor, account: account as IAccount });\n }\n }\n\n /**\n * Updates metadata object for the Pendo agent.\n *\n * @param options IPendoOptions\n */\n updateOptions(options: IPendoOptions): void {\n this.pendo?.updateOptions(options);\n }\n\n /**\n * Format Pendo\n *\n * @param ids string[]\n */\n formatPendoId(...ids: string[]): string {\n return (this.pendoIdFormatter ? ids.map(id => this.pendoIdFormatter!(id)) : ids).join('.');\n }\n\n /**\n * Shuts down the agent and cleans up all timers and listeners.\n */\n teardown(): void {\n this.pendo?.teardown();\n }\n\n /**\n * Checks if a given visitor id string is anonymous.\n * If no argument is given, calls with pendo.getVisitorId() to check current visitor status.\n */\n isAnonymousVisitor(visitorId?: string): boolean {\n return this.pendo?.isAnonymousVisitor(visitorId);\n }\n\n /**\n * Removes current visitor id and account id.\n * Triggers an identify event and reloads with a new anonymous visitor.\n */\n clearSession(): void {\n this.pendo?.clearSession();\n }\n\n /**\n * Loads Pendo Debugger and extends the global pendo object with additional functionality for debugging purposes.\n */\n enableDebugging(): void {\n this.pendo?.enableDebugging();\n }\n\n /**\n * Removes Pendo Debugger extension.\n */\n disableDebugging(): void {\n this.pendo?.disableDebugging();\n }\n\n /**\n * Method to manually track events. Requires a non-empty name string to collect event.\n */\n track(trackType: string, metadata?: Record<string, string | number | boolean | string[] | null>): void {\n this.pendo?.track(trackType, metadata);\n }\n}\n","import { Directive, inject, input, computed, signal } from '@angular/core';\nimport { IPendoDirective } from './ngx-pendo.interfaces';\nimport { NgxPendoService } from './ngx-pendo.service';\nimport { NgxPendoSectionDirective } from './ngx-pendo-section.directive';\n\n@Directive({\n selector: '[ngx-pendo-id]',\n standalone: true,\n host: {\n '[attr.data-pendo-id]': 'mergedPendoId()',\n '[attr.ngx-pendo-disable-inherit]': 'disableInherit()'\n }\n})\nexport class NgxPendoIdDirective implements IPendoDirective {\n pendoId = input<string>('', { alias: 'ngx-pendo-id' });\n\n inherit = input<boolean>(true, { alias: 'ngx-pendo-inherit' });\n\n parent = signal<NgxPendoSectionDirective | undefined>(undefined);\n\n mergedPendoId = computed<string>(() => {\n const pendoSections = [];\n\n let cur = this.inherit() ? this.parent() : null;\n while (cur) {\n pendoSections.unshift(cur.pendoSection());\n cur = cur.inherit() ? cur.parent() : null;\n }\n\n return this.service.formatPendoId(...pendoSections, this.pendoId());\n });\n\n disableInherit = computed<boolean | undefined>(() => (this.inherit() ? undefined : true));\n\n service = inject(NgxPendoService);\n}\n","import { Directive, input, computed, signal, contentChildren, effect } from '@angular/core';\nimport { IPendoDirective } from './ngx-pendo.interfaces';\nimport { NgxPendoIdDirective } from './ngx-pendo-id.directive';\n\n@Directive({\n selector: '[ngx-pendo-section]',\n standalone: true,\n host: {\n '[attr.data-pendo-section]': 'pendoSection()',\n '[attr.ngx-pendo-disable-inherit]': 'disableInherit()'\n }\n})\nexport class NgxPendoSectionDirective implements IPendoDirective {\n pendoSection = input<string>('', { alias: 'ngx-pendo-section' });\n\n inherit = input<boolean>(true, { alias: 'ngx-pendo-inherit' });\n\n parent = signal<NgxPendoSectionDirective | undefined>(undefined);\n\n idDirectives = contentChildren(NgxPendoIdDirective, { descendants: false });\n\n sectionDirectivs = contentChildren(NgxPendoSectionDirective, { descendants: false });\n\n disableInherit = computed<boolean | undefined>(() => (this.inherit() ? undefined : true));\n\n constructor() {\n effect(() => {\n [...this.idDirectives(), ...this.sectionDirectivs()].forEach(item => {\n if (item !== this) {\n item.parent.set(this);\n }\n });\n });\n }\n}\n","import { APP_INITIALIZER, isDevMode, Provider } from '@angular/core';\nimport { interval } from 'rxjs';\nimport { IPendoSettings } from './ngx-pendo.interfaces';\nimport { NGX_PENDO_WINDOW, NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\nimport { PendoWindow } from './ngx-pendo.types';\n\nconst DEFAULT_PENDO_SCRIPT_ORIGIN = 'https://cdn.pendo.io';\n\n// export const NGX_PENDO_INITIALIZER_PROVIDER = provideAppInitializer(() => {\n// const initializerFn = pendoInitializer(inject(NGX_PENDO_SETTINGS_TOKEN), inject(NGX_PENDO_WINDOW));\n// return initializerFn();\n// });\n\n// Keep the `APP_INITIALIZER` to support angular 17 and 18 version\nexport const NGX_PENDO_INITIALIZER_PROVIDER: Provider = {\n provide: APP_INITIALIZER,\n multi: true,\n useFactory: pendoInitializer,\n deps: [NGX_PENDO_SETTINGS_TOKEN, NGX_PENDO_WINDOW]\n};\n\nexport function pendoInitializer($settings: IPendoSettings, window: PendoWindow): () => Promise<void> {\n return async () => {\n const { pendoApiKey, pendoScriptOrigin } = $settings;\n if (!pendoApiKey) {\n if (isDevMode()) {\n console.error('Empty api key for Pendo. Make sure to provide one when initializing NgxPendoModule.');\n }\n\n return;\n }\n\n await new Promise<void>(resolve => {\n const script = document.createElement('script');\n script.async = true;\n script.src = `${pendoScriptOrigin || DEFAULT_PENDO_SCRIPT_ORIGIN}/agent/static/${pendoApiKey}/pendo.js`;\n document.head.appendChild(script);\n script.onerror = async () => {\n // The script may have been blocked by an ad blocker\n console.error('The pendo script may have been blocked.');\n resolve();\n };\n script.onload = async () => {\n // when enableDebugging should load extra js\n const sub = interval(100).subscribe(() => {\n if (window.pendo) {\n sub.unsubscribe();\n resolve();\n }\n });\n };\n });\n };\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-function-type */\n\nimport { InputSignal, WritableSignal, Provider } from '@angular/core';\n\nexport interface IPendoSettings {\n pendoApiKey: string;\n pendoScriptOrigin?: string;\n pendoIdFormatter?: (pendoId: string) => string;\n pendoInitializerProvider?: Provider;\n}\n\nexport interface IPendoDirective {\n inherit: InputSignal<boolean>;\n parent: WritableSignal<IPendoDirective | undefined>;\n}\n\n// The following interfaces and types are based on the Pendo documentation.\n// Please according to the Pendo documentation, here's the link: https://agent.pendo.io/\nexport interface IVisitor {\n id: string;\n [key: string]: string;\n}\n\nexport interface IAccount {\n id: string;\n [key: string]: string;\n}\n\nexport interface IPendoIdentity {\n visitor?: IVisitor;\n account?: IAccount;\n}\n\nexport interface IPendoOptions extends IPendoIdentity {\n // Core\n additionalApiKeys?: string[];\n annotateUrl?: Function;\n apiKey?: string;\n appAutoOrdering?: string[];\n autoFrameInstall?: boolean;\n contentHost?: string;\n cookieDomain?: string;\n dataHost?: string;\n disableCookies?: boolean;\n disableFeedback?: boolean;\n disablePendo?: boolean;\n disablePersistence?: boolean;\n frameIdentitySync?: boolean;\n ignoreHashRouting?: boolean;\n initializeImmediately?: boolean;\n observeShadowRoots?: boolean;\n leaderKey?: string[];\n localStorageOnly?: boolean;\n preferBroadcastChannel?: boolean;\n preferMutationObserver?: boolean;\n preventUnloadListener?: boolean;\n queryStringWhitelist?: string[] | Function;\n sanitizeUrl?: Function;\n selfHostedAgentUrl?: string;\n sendEventsWithPostOnly?: boolean;\n // Analytics\n allowedText?: string[];\n analytics?: {\n excludeEvents?: string[];\n };\n enableDebugEvents?: boolean;\n eventPropertyMatchParents?: boolean;\n excludeAllText?: boolean;\n excludeNonGuideAnalytics?: boolean;\n syntheticClicks?: {\n elementRemoval?: boolean;\n targetChanged?: boolean;\n };\n // Guides\n disableGlobalCSS?: boolean;\n disableGuidePseudoStyles?: boolean;\n disablePrefetch?: boolean;\n enableDesignerKeyboardShortcut?: boolean;\n enableGuideTimeout?: boolean;\n guideSeenTimeoutLength?: number;\n guideValidation?: boolean;\n guides?: {\n attachPoint?: string | Function;\n delay?: boolean;\n disabled?: boolean;\n globalScripts?: any[];\n timeout?: number;\n tooltip?: {\n arrowSize?: number;\n };\n };\n preventCodeInjection?: boolean;\n}\n\nexport interface IPendo {\n // Agent\n additionalApiKeys: string[];\n apiKey: string;\n getVersion(): string;\n initialize(options: IPendoOptions): void;\n isReady(): boolean;\n teardown(): void;\n\n // Classic Guides\n hideLauncher(): void;\n removeLauncher(): void;\n showLauncher(): void;\n toggleLauncher(): void;\n\n // Debugging\n addDebuggingFunctions(): void;\n disableDebugging(): void;\n disableLogging(): void;\n enableDebugging(): void;\n enableLogging(): void;\n isDebuggingEnabled(): void;\n logPublic(): void;\n\n // DOM\n dom(input: string): HTMLElement;\n\n // Events\n attachEvent(element: HTMLElement, evt: string, fn: (event: Event) => void, useCapture?: boolean): void;\n detachEvent(element: HTMLElement, evt: string, fn: (event: Event) => void, useCapture?: boolean): void;\n doNotProcess: string;\n flushNow(force?: boolean): void;\n isSendingEvents(): boolean;\n startSendingEvents(): boolean;\n stopSendingEvents(): boolean;\n stopSendingEvents(): boolean;\n track(trackType: string, metadata?: any): void;\n\n // TODO: Guides\n\n // Identity\n clearSession(): void;\n generate_unique_id(prefix?: string): string;\n getAccountId(): string | null;\n get_account_id(): string | null;\n getSerializedMetadata(): any;\n getVisitorId(): string;\n get_visitor_id(): string;\n identify(options: IPendoIdentity | string, accountId?: string): void;\n isAnonymousVisitor(visitorId?: string): boolean;\n set_account_id(newAccountId?: string): void;\n set_visitor_id(newVisitorId?: string): void;\n updateOptions(options: IPendoOptions): void;\n\n // URL\n url: {\n get: () => string;\n };\n normalizedUrl: string;\n getCurrentUrl: () => string;\n getNormalizedUrl: () => string;\n pageLoad: (url: string) => void;\n\n // TODO: Utility\n\n // TODO: Validation\n}\n","import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { NgxPendoIdDirective } from './ngx-pendo-id.directive';\nimport { NgxPendoSectionDirective } from './ngx-pendo-section.directive';\nimport { NGX_PENDO_INITIALIZER_PROVIDER } from './ngx-pendo.injectors';\nimport { IPendoSettings } from './ngx-pendo.interfaces';\nimport { NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\n\n@NgModule({\n imports: [NgxPendoIdDirective, NgxPendoSectionDirective],\n exports: [NgxPendoIdDirective, NgxPendoSectionDirective]\n})\nexport class NgxPendoModule {\n static forRoot(settings: IPendoSettings): ModuleWithProviders<NgxPendoModule> {\n return {\n ngModule: NgxPendoModule,\n providers: [\n {\n provide: NGX_PENDO_SETTINGS_TOKEN,\n useValue: settings\n },\n settings.pendoInitializerProvider || NGX_PENDO_INITIALIZER_PROVIDER\n ]\n };\n }\n\n static forChild(): ModuleWithProviders<NgxPendoModule> {\n return {\n ngModule: NgxPendoModule\n };\n }\n}\n","import { makeEnvironmentProviders } from '@angular/core';\nimport { NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\nimport { NGX_PENDO_INITIALIZER_PROVIDER } from './ngx-pendo.injectors';\nimport { IPendoSettings } from './ngx-pendo.interfaces';\n\nexport function provideNgxPendo(settings: IPendoSettings) {\n return makeEnvironmentProviders([\n {\n provide: NGX_PENDO_SETTINGS_TOKEN,\n useValue: settings\n },\n settings.pendoInitializerProvider || NGX_PENDO_INITIALIZER_PROVIDER\n ]);\n}\n","/*\n * Public API Surface of ngx-pendo\n */\n\nexport * from './lib/ngx-pendo-id.directive';\nexport * from './lib/ngx-pendo-section.directive';\nexport * from './lib/ngx-pendo.service';\nexport * from './lib/ngx-pendo.injectors';\nexport * from './lib/ngx-pendo.interfaces';\nexport * from './lib/ngx-pendo.module';\nexport * from './lib/ngx-pendo.provide';\nexport * from './lib/ngx-pendo.tokens';\nexport * from './lib/ngx-pendo.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAKa,wBAAwB,GAAG,IAAI,cAAc,CAAiB,oBAAoB,EAAE;AAC/F,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE;AACpC,CAAA;MAEY,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB,EAAE;AAClF,IAA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AA,OAAO,EAAE,wBAAwB;AACjC,YAAA,QAAQ,EAAE;AACX,SAAA;QACD,QAAQ,CAAC,wBAAwB,IAAI;AACtC,KAAA,CAAC;AACJ;;ACbA;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -19,9 +19,11 @@ interface IAccount {
19
19
  id: string;
20
20
  [key: string]: string;
21
21
  }
22
- interface IPendoOptions {
22
+ interface IPendoIdentity {
23
23
  visitor?: IVisitor;
24
24
  account?: IAccount;
25
+ }
26
+ interface IPendoOptions extends IPendoIdentity {
25
27
  additionalApiKeys?: string[];
26
28
  annotateUrl?: Function;
27
29
  apiKey?: string;
@@ -78,38 +80,46 @@ interface IPendoOptions {
78
80
  };
79
81
  preventCodeInjection?: boolean;
80
82
  }
81
- interface ISerializedMetadata {
82
- }
83
83
  interface IPendo {
84
84
  additionalApiKeys: string[];
85
85
  apiKey: string;
86
- getVersion: () => string;
87
- initialize: (options: IPendoOptions) => void;
88
- isReady: () => boolean;
89
- teardown: () => void;
90
- hideLauncher: () => void;
91
- removeLauncher: () => void;
92
- showLauncher: () => void;
93
- toggleLauncher: () => void;
94
- addDebuggingFunctions: () => void;
95
- disableDebugging: () => void;
96
- disableLogging: () => void;
97
- enableDebugging: () => void;
98
- enableLogging: () => void;
99
- isDebuggingEnabled: () => void;
100
- logPublic: () => void;
101
- clearSession: () => void;
102
- generate_unique_id: (prefix?: string) => string;
103
- getAccountId: () => string | null;
104
- get_account_id: () => string | null;
105
- getSerializedMetadata: () => ISerializedMetadata;
106
- getVisitorId: () => string;
107
- get_visitor_id: () => string;
108
- identify: (options: Pick<IPendoOptions, 'visitor' | 'account'> | string, accountId?: string) => void;
109
- isAnonymousVisitor: (visitorId?: string) => boolean;
110
- set_account_id: (newAccountId?: string) => void;
111
- set_visitor_id: (newVisitorId?: string) => void;
112
- updateOptions: (options: IPendoOptions) => void;
86
+ getVersion(): string;
87
+ initialize(options: IPendoOptions): void;
88
+ isReady(): boolean;
89
+ teardown(): void;
90
+ hideLauncher(): void;
91
+ removeLauncher(): void;
92
+ showLauncher(): void;
93
+ toggleLauncher(): void;
94
+ addDebuggingFunctions(): void;
95
+ disableDebugging(): void;
96
+ disableLogging(): void;
97
+ enableDebugging(): void;
98
+ enableLogging(): void;
99
+ isDebuggingEnabled(): void;
100
+ logPublic(): void;
101
+ dom(input: string): HTMLElement;
102
+ attachEvent(element: HTMLElement, evt: string, fn: (event: Event) => void, useCapture?: boolean): void;
103
+ detachEvent(element: HTMLElement, evt: string, fn: (event: Event) => void, useCapture?: boolean): void;
104
+ doNotProcess: string;
105
+ flushNow(force?: boolean): void;
106
+ isSendingEvents(): boolean;
107
+ startSendingEvents(): boolean;
108
+ stopSendingEvents(): boolean;
109
+ stopSendingEvents(): boolean;
110
+ track(trackType: string, metadata?: any): void;
111
+ clearSession(): void;
112
+ generate_unique_id(prefix?: string): string;
113
+ getAccountId(): string | null;
114
+ get_account_id(): string | null;
115
+ getSerializedMetadata(): any;
116
+ getVisitorId(): string;
117
+ get_visitor_id(): string;
118
+ identify(options: IPendoIdentity | string, accountId?: string): void;
119
+ isAnonymousVisitor(visitorId?: string): boolean;
120
+ set_account_id(newAccountId?: string): void;
121
+ set_visitor_id(newVisitorId?: string): void;
122
+ updateOptions(options: IPendoOptions): void;
113
123
  url: {
114
124
  get: () => string;
115
125
  };
@@ -120,12 +130,8 @@ interface IPendo {
120
130
  }
121
131
 
122
132
  declare class NgxPendoService {
123
- private pendoIdFormatter?;
124
133
  private pendo;
125
- /**
126
- * Constructor
127
- */
128
- constructor();
134
+ private pendoIdFormatter;
129
135
  /**
130
136
  * Completely re-initialize the Agent with new options
131
137
  *
@@ -176,6 +182,10 @@ declare class NgxPendoService {
176
182
  * Removes Pendo Debugger extension.
177
183
  */
178
184
  disableDebugging(): void;
185
+ /**
186
+ * Method to manually track events. Requires a non-empty name string to collect event.
187
+ */
188
+ track(trackType: string, metadata?: Record<string, string | number | boolean | string[] | null>): void;
179
189
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxPendoService, never>;
180
190
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<NgxPendoService>;
181
191
  }
@@ -225,4 +235,4 @@ declare const NGX_PENDO_WINDOW: InjectionToken<PendoWindow>;
225
235
  declare const NGX_PENDO_CONTEXT: InjectionToken<IPendo>;
226
236
 
227
237
  export { NGX_PENDO_CONTEXT, NGX_PENDO_INITIALIZER_PROVIDER, NGX_PENDO_SETTINGS_TOKEN, NGX_PENDO_WINDOW, NgxPendoIdDirective, NgxPendoModule, NgxPendoSectionDirective, NgxPendoService, pendoInitializer, provideNgxPendo };
228
- export type { IAccount, IPendo, IPendoDirective, IPendoOptions, IPendoSettings, ISerializedMetadata, IVisitor, PendoWindow };
238
+ export type { IAccount, IPendo, IPendoDirective, IPendoIdentity, IPendoOptions, IPendoSettings, IVisitor, PendoWindow };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-pendo",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "A simple wrapper to load Pendo by angular way",
5
5
  "contributors": [
6
6
  {