Skip to main content

What is Form module

The Form module is part of the Proview SDK, exposed as Proview.form. It provides a complete solution for loading, rendering, and managing dynamic forms with integrated authentication. Once initialized, it lets your application:
  • Load forms — render forms dynamically by form ID.
  • Submit forms — handle form submission and validation automatically.
  • Mount UI — display forms in sidepanel, popup, or inline layout modes.
  • React to events — subscribe to ready, submitted, and error events.

Quickstart

1. Load the SDK and initialize

Declare Proview.form() in the modules array when calling Proview.init(). The dsn and credential are inherited — no per-module init call needed.

2. Access user object

Once initialized, the user object becomes available globally at Proview.user and is Firebase-compatible with getIdToken() method.

3. Mount UI

Mount the form UI into a container element.

4. Open form

Open the form to load data and display the UI.

5. Subscribe to events

Listen to form lifecycle events.

6. Teardown

When done, unmount the UI.

API Reference

Proview.form

The form module is automatically initialized when Proview.form() is included in the modules array passed to Proview.init(). The dsn and credential are inherited from the global init — no separate per-module call is needed.
Proview.form exposes:
The authenticated user is available globally at Proview.user after initialization.

form.mount(options)

Mounts the form UI into a container element. MountOptions
MountedFormUi
Example:

Proview.form.open()

Loads form data and displays the form UI. Uses the formId specified in mount(). FormInstance
Example:

User Object

After initializing the form module, Proview.user provides a Firebase-compatible user object accessible globally. User Interface
Example:

Firebase Authentication

Proview.auth.FirebaseAuthStrategy(config)

Creates a Firebase authentication credential for use with the Proview SDK modules. Input
Returns — FirebaseAuthStrategy A credential object passed to Proview.init(). All modules declared in the modules array inherit it automatically. Example:

Form Events

The FormInstance emits events that you can subscribe to using the on() method. Event names and payloads Example:

Mount Modes

The form module supports three layout modes for the form UI. Example:

Error Handling

Form errors follow a consistent structure. Error Structure
Common Error Codes Example: