@open-formulieren/sdk
v3.4.2
Published
[](https://www.npmjs.com/package/@open-formulieren/sdk) [](https://codecov
Readme
Open Forms SDK
The Open Forms SDK is the frontend to the Open Forms backend. We publish it as both an NPM library of components and pre-built Docker image.
The documentation is available online. The SDK documentation is available in our Storybook.
Audience
The target audience for this library is developers who want to embed the SDK into their own frontend bundles, and users that may want to use our SDK implementation in their storybook for documentation and visual regression testing.
Usage
The package exports two ways to use the library:
- Importing and composing the invididual modules (ESM, recommended)
- Importing the library as a whole (ESM or UMD bundle)
The former approach allows more fine-grained control and should exclude code/dependencies that aren't used and result in smaller builds, while the latter gives you the public API as it would be available in the browser.
Given the target audience, we expect developers to use option 1.
Using the library
If you decide that using the SDK itself is sufficient, then your usage comes down to:
// JS API
import {ANALYTICS_PROVIDERS, OpenForm, VERSION} from '@open-formulieren/sdk';
// import the (default) stylesheet
import '@open-formulieren/sdk/styles.css';
const form = new OpenForm(targetNode, options);
form.init();