@yorlet/js iframes your hosted qualification form so leads can enquire from your own site. The form authenticates itself — you never put a secret key in the browser.
Install
- npm
- Script tag
Embed a qualification form
Copy a publishable key from API keys and the form token from a qualification configuration. The token is shown in the Form token column and on the configuration’s details page. It is not the configuration object id (lqc_…).
mount returns a handle with unmount(), which removes the iframe and stops listening for messages.
Options
The first argument can be a CSS selector or an
HTMLElement.
Testing against a local hosted app
You do not needorigin in production. Yorlet.init() already loads the form from the production hosted app. Pass origin only when you are testing against a local frontend-app:
What happens after submit
The lead’s answers are stored on an enquiry in your pipeline. If the same person submits the same form again within seven days, Yorlet updates that enquiry instead of creating another. Passunit on a listing page so the enquiry records that property. Further submits from the same person add more properties to the same enquiry. You do not need to call the Enquiries API from the page. If you want to send them somewhere else after they finish, handle onComplete — the iframe will not navigate the parent page itself.
For a full walkthrough, see Embed a qualification form. If you are using React, use @yorlet/react instead of calling mount yourself.