Skip to main content
Version: Next 🚧

Audit

The AuditService notifies the Sinequa server of audit events such as login, logout, document interactions, and route changes.

note

Use the notify() function from @sinequa/atomic whenever possible. This service exists for compatibility with the Sinequa SDK.

Methods​

notify()​

Notifies the server of a set of audit events.

notify(auditEvents: AuditEvents): void
NameTypeRequiredDescription
auditEventsAuditEvents✓The audit events to send.

Example

example.component.ts
import { inject } from '@angular/core';
import { AuditService } from '@sinequa/atomic-angular';

const auditService = inject(AuditService);
auditService.notify({ type: 'Custom_Event' });

notifyLogin()​

Sends a login success audit event.

notifyLogin(): void

Example

inject(AuditService).notifyLogin();

notifyLogout()​

Sends a logout audit event.

notifyLogout(): void

Example

inject(AuditService).notifyLogout();

notifyDocument()​

Notifies the server of a document interaction event.

notifyDocument(
auditEventType: AuditEventType | AuditEventTypeValues | {} & Record<never, never>,
doc: Article,
resultsOrId: Result | string,
parameters?: Record<string, string | number | boolean | undefined>,
rfmParameters?: Record<string, string | number | boolean | undefined>
): void
NameTypeRequiredDescription
auditEventTypeAuditEventType | AuditEventTypeValues✓The type of document audit event.
docArticle✓The document (article) in question.
resultsOrIdResult | string✓The result or result ID containing the document.
parametersRecord<string, string | number | boolean | undefined>Additional parameters.
rfmParametersRecord<string, string | number | boolean | undefined>Additional RFM parameters.

Example

example.component.ts
import { inject } from '@angular/core';
import { AuditService } from '@sinequa/atomic-angular';

inject(AuditService).notifyDocument('Document_View', article, 'resultId123');

notifyRouteChange()​

Notifies the server of a route change event.

notifyRouteChange(url: string): void
NameTypeRequiredDescription
urlstring✓The URL of the new route.

Example

inject(AuditService).notifyRouteChange('/new-route');