Events represent activity that has occurred within WorkOS or within third-party identity and directory providers. They are used to keep your app in sync with WorkOS data. For more details on consuming events in your app, check out the data syncing guide.
Refer to the Events page for a full list of events that WorkOS emits.
Get a list of all of events up to 30 days old.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS(process.env.WORKOS_API_KEY); const listOfEvents = await workos.events.listEvents({ events: [ 'dsync.activated', 'dsync.deleted', 'dsync.user.created', 'dsync.user.updated', 'dsync.user.deleted', ], });
events .listEvents()Parameters Returns object