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

Ensure the Proview SDK script is loaded (see Getting Started).

2. Initialize credential

The SDK supports Firebase as a credentialing provider for authentication.

3. Initialize form module

Initialize the form module with the Firebase credential.

4. Access user object

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

5. Mount UI

Mount the form UI into a container element.

6. Open form

Open the form to load data and display the UI.

7. Subscribe to events

Listen to form lifecycle events.

8. Teardown

When done, unmount the UI.

API Reference

Proview.form.init(options)

Creates a form module instance with integrated authentication. Input
ReturnsFormModule
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:

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
ReturnsFirebaseAuthStrategy A credential object that can be passed to any Proview SDK module initialization. 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: