Support for user-generated content is coming soon.
Problem statement
You may want to collect input from your clients, readers, or users through a form in your frontend. The iframe-based integration gives you a ready-to-use form flow with less frontend setup, so you can get started quickly.What you are doing
You will add Publive’s prebuilt form flow to your frontend by loading the hosted form experience in an iframe and handling submissions through reader-side API routes. This is the default form integration approach in the reference app. It is optimized for speed of setup and low implementation effort.How this approach works
The iframe flow in the reference app uses these routes:pages/api/reader/custom-forms-schema.tspages/api/reader/user-generated-content/submit.ts
- Your app fetches the hosted iframe schema HTML through
/api/reader/custom-forms-schema. - Your frontend renders that prebuilt experience inside an iframe.
- The iframe posts form data to
/api/reader/user-generated-content/submit. - The submit route verifies reCAPTCHA and forwards the payload with
sdk.utils.form.submitForm(...).
1. Proxy the hosted iframe schema page
Createpages/api/reader/custom-forms-schema.ts:
2. Render the iframe in your page
Once the proxy route exists, render it in an iframe:3. Add the reader submit route
Createpages/api/reader/user-generated-content/submit.ts:
4. Configure reCAPTCHA
This route depends on reCAPTCHA verification before submit. In the reference app, the secret is resolved from publisher configuration and falls back to an environment variable. Make sure your server has access to the reCAPTCHA secret used for verification.When to use iframe forms
Use this approach when:- you want the fastest path to a working form
- you do not want to build a custom renderer yet
- a prebuilt form experience is acceptable
- you want the default integration path with minimal setup
Tradeoffs
Pros:- very fast to start
- less frontend implementation work
- useful for direct setup without much wiring
- you cannot meaningfully change the UI
- styling and layout control are limited
- it will not align tightly with a custom design system