Put a form on your website
Last updated 5 October 2026
Any Xenpai form can be shown on your own website with one line of code. It works on any site or website builder that lets you add your own HTML. Steps, uploads, payments and the thank-you message all work as they do on the form's own page.
Get the code
- In Xenpai, open Forms and choose Embed next to the form. Pick how it should show, then copy the code.
- Or ask for it in the chat: "put the registration form on our website".
Right in the page
Paste this where the form should appear:
<script src="https://app.xenpai.app/embed.js"
data-form="FORM-ID" async></script>FORM-ID is the part after /f/ in the form's link. The form fills the width it's given and grows to its own height, so there's no scroll bar inside it. On forms with steps, moving to the next step brings the top of the form back into view.
Behind a button
Shows a button that opens the form over your page:
<script src="https://app.xenpai.app/embed.js"
data-form="FORM-ID"
data-mode="button"
data-label="Register now"
data-color="#2f6fed" async></script>- data-label: the button's text (default "Open form").
- data-color: the button's color as #rrggbb.
- The form closes with its × button, a click outside it, or Escape. Once it's sent, opening it again starts a fresh form.
Good to know
- Each script tag places one form, so a page can show several.
- Payment opens in a new tab, because payment pages can't be shown inside another website. The receipt shows there once they've paid.
- Personal links (to fix an answer or finish a saved form) open the form on its own page.
- Answers stay inside the form. Your page only learns the form's height and when it's been sent, and the script checks those messages really come from Xenpai.
- Closed forms show their closing message wherever they're embedded.
More for developers
To get each submission in your own system as it arrives, see webhooks. All the developer pages are on Developers.