FormXen
Embed forms on your own site
Two ways to publish
Public fill link
Every published form gets a link that anyone can open and submit without an account. Use it when the form is the thing you are sending people to — a registration, an application, a survey.
Embed widget
A single script tag mounts the feedback widget on your page. Use it when responding should not interrupt what the person is doing, and when you want the submission tied to the signed-in user.
Embedding a form
Basic embed
One script tag, one token. Drop it into the page where the widget should appear.
<script
src="https://app.formxen.com/embed/feedback-widget.js"
data-feedback-token="YOUR_FEEDBACK_TOKEN"
async
></script>Secure submitter IDs
If the submission should be attributed to a signed-in user, do not send the raw user ID from the browser — anyone can edit that. Compute an HMAC of the user ID on your server with your secret, pass the digest, and pass the plain ID alongside it so the server can verify the two match.
<script
src="https://app.formxen.com/embed/feedback-widget.js"
data-feedback-token="YOUR_FEEDBACK_TOKEN"
data-user-id="HMAC_HEX_DIGEST"
data-user-id-plain="YOUR_LOGGED_IN_USER_ID"
async
></script>Prefilled hidden fields
Pass values straight into the form’s hidden fields — the plan the user is on, the page they were viewing, the campaign that brought them. They arrive stored with the submission like any other answer.
<script
src="https://app.formxen.com/embed/feedback-widget.js"
data-feedback-token="YOUR_FEEDBACK_TOKEN"
data-initial-values='{"hidden-field-id":"campaign-42"}'
async
></script>Script attributes
- data-feedback-token
- Required. Identifies which published form the widget collects for.
- data-user-id
- Optional. The HMAC hex digest of your user ID, computed on your server. Never the raw ID.
- data-user-id-plain
- Optional, and only alongside data-user-id. The plain user ID, so the server can verify the digest.
- data-initial-values
- Optional. A JSON object mapping hidden field IDs to the values they should arrive with.
- async
- Recommended. Keeps the widget from blocking the rest of your page while it loads.
How it is set up
- Build and publish the form, then apply a theme so it matches the site it will sit on.
- Copy the feedback token for that form from the app.
- Add the script tag to your page with the token set.
- If submissions should be attributed to a signed-in user, compute the HMAC server-side and pass both the digest and the plain ID.
- Add any hidden fields you want prefilled, then set them through data-initial-values.