Skip to main content
Use this reference to find every option, method, return value, and scheduler event for the Default Pixel (index.js) and Forms SDK (sdk.js). Read Understand the Pixel and Forms SDK first to learn how the two scripts work together. Everything on this page comes from the script’s own source. We call out anything we could not confirm.

Entry points

Both scripts read scheduler configuration from the same block and post to one shared scheduler event bus. on(), scheduler.*, and submitForm() therefore behave the same from either script. See Methods below for exactly which methods live on which global.

Configuration

Shared configuration options

Set these options as window.__defaultPixel__, or pass them to DefaultPixelSDK.init(options) with the same shape. The init() path is useful when the key is only known at runtime. The SDK reads window.__defaultPixel__ automatically on load. A later init() call updates the configuration in place, but it does not re-run identity or session warmup. The Pixel (index.js) has no init() to call, but it reads key, schedulerOrigins, and autoDisplayScheduler directly off the same window.__defaultPixel__ block. Only endpoint is SDK-only.
The Pixel (index.js) has no equivalent init() call. It always uses Default’s standard endpoint. It does read schedulerOrigins and autoDisplayScheduler off window.__defaultPixel__. See the table above. Automatically detected forms, which involve no submitForm() call, read only the { target, loader } shape of autoDisplayScheduler. The true and false values do not apply there, because the calendar always displays somewhere on a handoff. When target is set for an automatically detected form, the loading indicator defaults to shown. Set loader: false there to hide it. This default is the opposite of submitForm()’s. See The scheduler experience in the guide for what this means in practice.

Methods

on, submitForm, and scheduler.* are on both window.DefaultPixel and window.DefaultPixelSDK. init and recordFormInteraction are on window.DefaultPixelSDK only.

init

DefaultPixelSDK.init(options). This method exists only on window.DefaultPixelSDK, and the Pixel (index.js) has no equivalent call. Every call configures the SDK, and the first call also starts it. The start warms identity and session, and attaches the email-blur listener that powers pre-enrichment. The start also checks for a pending scheduler handoff left over from a same-page redirect. The method returns nothing. See Shared configuration options above for options. The SDK also calls this automatically on script load if window.__defaultPixel__.key is present. Most integrations never call it directly.

on

DefaultPixelSDK.on(eventType, handler). Subscribes to a raw scheduler event. Returns an unsubscribe function.
eventType is one of the five values in Scheduler events below. Most integrations use the typed helpers under scheduler.* instead. The helpers are equivalent, but they save you from typing the event name as a string.

submitForm

DefaultPixelSDK.submitForm(options). You can also call it as DefaultPixel.submitForm(options) on the Pixel bundle, but most integrations only need it via the SDK (see Entry points). It submits a set of field values directly to a known Pixel form, without going through form detection. It returns a promise, never throws on a failed request, and resolves with success: false instead.
The return value: When multiple <form> elements are on the page, and you call submitForm({ pixelFormId, ... }) without also passing formId, the SDK guesses which DOM form you mean. The guess only enriches the submission with the form’s name, action, and class, and it never changes what gets submitted. The SDK picks the currently focused field’s form. If there is more than one form on the page, it picks a form tagged with a matching data-pixel-form-id or data-form-id attribute. To remove the ambiguity, pass formId explicitly or add one of those attributes. Your workspace’s form editor includes a live version of this call, pre-filled with your real public key, form id, and field names. To find it, open Forms, select a form, then open its Install tab, section Use the SDK. See Manual submission (the SDK) in the guide for how that sample relates to the initialization-timing guidance on this page.

recordFormInteraction

DefaultPixelSDK.recordFormInteraction(options). This method exists only on window.DefaultPixelSDK, and the Pixel (index.js) has no equivalent call. It manually mirrors the automatic email-blur warmup that powers pre-enrichment. Use it on hosts where the fields are not inside a native <form> element, so the SDK’s own listener has nothing to attach to. It never throws and swallows failures. The warmup is best-effort, not a required call.
Use pixelFormId only with submitForm(). If you call both methods, use the same HTML form ID in both calls:

scheduler

DefaultPixelSDK.scheduler. A small object of typed helpers, all built on on() above. Each onX helper returns an unsubscribe function, same as on().

Scheduler events

Both on() and scheduler.onX react to messages that the embedded calendar posts. You can subscribe from either window.DefaultPixel or window.DefaultPixelSDK, because the two scripts share one event bus. Default validates each event against schedulerOrigins before your handler runs. It drops anything from an origin outside that list. You can also close the calendar from your own code at any time, without waiting for a scheduler event:

What gets captured automatically

Whether a submission comes from automatic detection or submitForm(), Default fills in the same context fields for you:

Server contract (SDK submissions)

submitForm() posts to the same submission endpoint as automatically detected forms. Default tags the request so it can tell the two apart:
  • The request includes the Pixel form id when you passed pixelFormId. It also includes a marker that the submission came from the SDK rather than automatic detection.
  • If the form id doesn’t belong to the domain tied to your public key, the request fails with a 404.
  • The workflow attached to the form fires the same way it would for any other submission to that form.

Troubleshooting

See Troubleshooting in the integration guide for symptom-to-fix guidance, including the scheduler-latency issue this reference doesn’t repeat here.

Set up the Pixel and Forms SDK

Connect a domain, approve a form, install the SDK, and verify a workflow.

Build a reliable Forms SDK flow

Apply the recommended initialization, submission, and scheduler pattern.

Understand the full integration

Learn how identity, form capture, workflows, and scheduler handoffs work together.