Skip to content

Status Page Embedding

To render a customer status page instead of the registration flow, we provide publicVisitId in addition to just the locationId in the configuration options:

const waitwhile = Waitwhile.Embed({
locationId: 'my-location-id',
publicVisitId: 'my-public-visit-id',
});
// Then we render as usual
waitwhile.render('main')

Permanent links are a great way to direct customers to a specific page on your site that includes the embedded widget, instantly displaying their status page.

To conditionally load a status page based on a query parameter, simply check the URL before initializing the embed:

const url = window.location.href;
const urlObj = new URL(url);
const params = new URLSearchParams(urlObj.search);
const publicVisitId = params.get('visit');
const waitwhile = Waitwhile.Embed({
locationId: 'my-location-id',
publicVisitId,
});

When the publicVisitId is present, the status page will be displayed. If not, the script will fall back to the registration process.

Demos

Rendering a status page

Here’s a simple example that shows the status page by using a hard-coded value for the visit query parameter, which sets the publicVisitId configuration option.

See Waitwhile Embed - Status page example on CodePen.