User Auth Data & Events
The User Auth drop-in uses the event bus to emit and listen to events for communication between drop-ins and external integrations. For common events shared across multiple drop-ins (such as locale, error, authenticated, etc.), see the Common events reference.
Version: 2.1.1
Events reference
| Event | Direction | Description |
|---|---|---|
| auth/error | Emits | Emitted when an error occurs |
Event details
The following sections provide detailed information about each event, including its direction, data payload structure, and usage examples.
auth/error (emits)
Emitted when an error occurs
Data payload
{ source: string; type: string; error: Error | string }| Property | Type | Description |
|---|---|---|
source | string | See type definition in source code |
type | string | See type definition in source code |
error | Error | string | See type definition in source code |
Usage
Listen to this event in your storefront:
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 listeningauthErrorListener.off();