Quickstart

Exchange a publishable key, list published forms, load one page into FieldStore.

Prerequisites

Scopes on the key: forms.schemas:read, forms.submissions:read, forms.submissions:write. Full exchange details: Authentication.

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)

console.log(client.store.fields())

Clone the repo and serve the demo (allowlist http://localhost:4173):

git clone https://github.com/UD-Ultradigital/comprehendly-sdk-js.git
cd comprehendly-sdk-js
cp demo/env.example.js demo/env.js   # set publishableKey
npm run demo
# open http://localhost:4173/demo/

Swift

import ComprehendlyForms

let client = ComprehendlyClient(publishableKey: "pk_test_…")
try await client.exchange()
let catalog = try await client.catalogList()
let page = try await client.pageGet(pageId)
print(client.store.fields)

Default request Origin is https://ios-demo.comprehendly.nz. Add that exact origin to the key allowlist, or pass a different origin: that matches the allowlist. Package install: Swift.

Next

Draw inputs from the store: Render a form. Or map host widgets: Bind existing fields.