Skip to main content

Interface: AllegroSDK

Defined in: types.ts:69

The top-level Allegro SDK instance, available as window.allegro.

Example

window.allegro.push((allegro) => {
console.log(allegro.member.isAuthenticated());
});

Methods

debug()?

optional debug(): void

Defined in: types.ts:123

Enable SDK debug mode from the console: window.allegro.debug()

Returns

void


push()

push(callback): void

Defined in: types.ts:87

Enqueue a callback to run once the SDK is ready.

If the SDK has already initialised, the callback is invoked synchronously. This mirrors the window.allegro.push(fn) usage pattern.

Parameters

ParameterTypeDescription
callbackAllegroCallbackFunction that receives the fully initialised SDK instance.

Returns

void

Example

window.allegro.push((allegro) => {
if (allegro.member.isAuthenticated()) {
console.log('Logged in!');
}
});

track()

track(eventName, data?): Promise<TrackResponse>

Defined in: types.ts:108

Track a named event with optional metadata.

Page context (URL, title, referer) is collected automatically. Pass additional fields via data to enrich the event.

Parameters

ParameterTypeDescription
eventNamestringDescriptive snake_case event name, e.g. "article_read".
data?TrackEventDataOptional event metadata.

Returns

Promise<TrackResponse>

Resolves with the recorded event ID.

Example

await allegro.track('article_read', {
content_id: '12345',
content_type: 'article',
publisher: 'newsroom',
});

Properties

PropertyTypeDescriptionDefined in
componentsRecord<string, typeof HTMLElement>Registered custom web components.types.ts:117
interactionInteractionNamespaceInteraction trigger and management methods.types.ts:114
magicLinkValidation?"authenticated" | "failed" | nullThe result of magic link token validation, if one was attempted on this page load. Set synchronously before the corresponding window event is dispatched, so components that load after the event fires can still read the outcome.types.ts:131
memberMemberNamespaceMember authentication and identity methods.types.ts:111
tenantTenantConfigTenant-specific configuration (login providers, cookie domain, etc.).types.ts:120