Scheduler Events

Every public event the OnePath scheduler dispatches or accepts, grouped by whether you listen for them or dispatch them yourself.

All events fire on the document. Names and payload field shapes are part of the public contract — they will not change without a new event name and a deprecation window. New optional fields may be added over time.


Events you listen for

These are events OnePath dispatches. Use addEventListener on the document to handle each one.

onepath:config-ready

Fires when OnePath finishes loading your account configuration — brand colors, business info, which widgets are enabled. Listen for this if you want to read those values before your own UI renders.

document.addEventListener('onepath:config-ready', (e) => {
  const { account, channels } = e.detail;
  console.log(account.name);                    // your business name
  console.log(account.brand_color);             // hex color
  console.log(channels.web_scheduler.enabled);  // true / false
});

What's in event.detail:

  • account — name, brand_color, text_color, logo_url, phone, full_address
  • channels — web_scheduler.enabled, web_chat.enabled

onepath:widget-ready

Fires once per widget after it has loaded and authenticated. Useful for showing your own UI ("Chat with us" button, a tracking pixel, anything that should appear only after OnePath is ready) at the right moment.

document.addEventListener('onepath:widget-ready', (e) => {
  if (e.detail.name === 'scheduler') {
    // OnePath scheduler is loaded and ready to receive open events
  }
});

What's in event.detail:

  • name — which widget became ready (currently always "scheduler")
  • config — the same account configuration available on window.onepath.config

onepath:webscheduler:task_created

Fires when a visitor submits a service request through the scheduler — a lead is captured but no appointment has been booked yet. Wire this to your lead tracking or "thanks for getting in touch" follow-up.

document.addEventListener('onepath:webscheduler:task_created', (e) => {
  const { customer, location } = e.detail;
  // e.g. send to your analytics
  gtag('event', 'lead_submitted', {
    customer_name:  customer.full_name,
    customer_phone: customer.contacts.phone,
    address:        location.address,
  });
});

What's in event.detail:

  • customer.full_name — the visitor's name
  • customer.contacts.email / customer.contacts.phone
  • location.address — the service address they entered

onepath:webscheduler:appointment_created

Fires when a visitor books an appointment end-to-end. Wire this to your conversion tracking, calendar sync, or a post-booking redirect.

document.addEventListener('onepath:webscheduler:appointment_created', (e) => {
  const { customer, location, time, timezone } = e.detail;
  // e.g. mark a conversion
  gtag('event', 'appointment_booked', {
    value:            1,
    appointment_time: time,
    timezone:         timezone,
  });
});

What's in event.detail:

  • customer — same fields as task_created (full_name, contacts.email, contacts.phone)
  • location.address
  • time — ISO 8601 timestamp string of the appointment window start
  • timezone — IANA timezone name (e.g. America/New_York) or null

Events you dispatch

These are events you fire from your code to control the OnePath widgets.

onepath:webscheduler:open

Opens the scheduler from your own form or button, optionally pre-filling phone, name, and notes. See the Form-Trigger Integration guide for the full pattern, including the loader.js placement warning and existing-customer behavior.

document.dispatchEvent(new CustomEvent('onepath:webscheduler:open', {
  detail: {
    phone: '5551234567',
    name:  'Jane Doe',
    notes: 'Leaky faucet'
  }
}));

What goes in event.detail (all optional):

  • phone — applied only when at least 10 digits; shorter values are ignored
  • name — pre-fills the name on the address step (a visitor already in OnePath's records takes precedence over your form's value)
  • notes — written to the request notes field
Previous
Form-Trigger Integration