Skip to content

User Auth Data & Events

The User Auth drop-in emits authentication state changes, enabling other drop-ins to respond to login, logout, and authentication validation events across your storefront.

Version: 2.1.5

Events reference

Drop-ins communicate via the event bus.

EventDirectionDescription
auth/errorEmitsEmitted when an error occurs.
auth/group-uidEmitsEmitted when a specific condition or state change occurs.

Event details

auth/error (emits)

Emitted when an error occurs.

Event payload

{ source: string; type: string; error: Error | string }

Usage

import { events } from '@dropins/tools/event-bus.js';
const authErrorListener = events.on('auth/error', (data) => {
console.log('auth/error event received:', data);
// Add your custom logic here
});
// Later, when you want to stop listening
authErrorListener.off();

auth/group-uid (emits)

Emitted when a specific condition or state change occurs.

Event payload

string

Usage

import { events } from '@dropins/tools/event-bus.js';
const authGroupUidListener = events.on('auth/group-uid', (data) => {
console.log('auth/group-uid event received:', data);
// Add your custom logic here
});
// Later, when you want to stop listening
authGroupUidListener.off();