Render a form from a page
Use case: the host app has no form UI. Load a published page_id and let the SDK draw primitive controls.
Steps
- Authenticate (exchange).
catalog.list()if you do not already have a page UUID.page.get(pageId)— loads FieldStore with fillable fields.- Mount generated UI (
FormView/ walkstore.fields()). - On submit,
submissions.savewithstore.values()keyed byfield_name.
JavaScript
import { Comprehendly } from '../src/index.js'
const client = new Comprehendly({ publishableKey: 'pk_test_…' })
await client.exchange()
const catalog = await client.catalog.list()
const pageId = catalog.forms[0].id
const page = await client.page.get(pageId)
for (const field of client.store.fields()) {
if (!field.generated) continue
// create input; on input:
client.store.set({ fieldName: field.fieldName, value, source: 'user' })
}
Runnable: clone comprehendly-sdk-js, run the demo server; the Generated section is this path.
Swift
let client = ComprehendlyClient(publishableKey: "pk_test_…")
try await client.exchange()
let page = try await client.pageGet(pageId)
// SwiftUI
ComprehendlyFormView(store: client.store)
Limits
- Linear list only. No page layout, columns, or custom CSS from the Comprehendly editor.
- Rating, score, and tree elements are in the store but not drawn in v1 generated UI.
- If you need pixel-matched branding, use bind or the iframe widget.