Skip to content

Company Management Data & Events

The Company Management 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.

Events reference

EventDirectionDescription
company/updatedEmitsEmitted when the component state is updated
companyContext/changedListensFired by Company Context (companyContext) when a change occurs

Event details

The following sections provide detailed information about each event, including its direction, data payload structure, and usage examples.

company/updated (emits)

Emitted when the component state is updated

Data payload

{ company?: any; message?: string; error?: any }
PropertyTypeDescription
companyany (optional)See type definition in source code
messagestring (optional)See type definition in source code
errorany (optional)See type definition in source code

Usage

Listen to this event in your storefront:

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

companyContext/changed (listens)

Fired by Company Context (companyContext) when a change occurs

Data payload

string | null | undefined

Usage

Listen to this event in your storefront:

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