React-embed
Embed Formsort flows within react components.
This is a handy wrapper around @formsort/web-embed-api.
Once you are finished writing your React-embed code, check out our Setting up a dev environment doc to begin testing the embed in your webpage.
Installation
Add @formsort/react-embed
to your project by executing yarn add @formsort/react-embed
or npm install @formsort/react-embed
.
Usage
Here's an example of basic usage:
Events
You can add event listeners to flows like Flowloaded
, redirect
etc. See all event listeners.
Props
Prop name | Description | Req'd | Example values |
---|---|---|---|
clientLabel | client name | yes |
|
flowLabel | flow name | yes |
|
variantLabel | variant name | no |
|
responderUuid | responder uuid to load existing answers for | no |
|
formsortEnv | formsort integrations environment label, if not using production | no |
|
queryParams | additional query params, to pre-populate answers in the form | no |
|
embedConfig | config passed to the underlying
| no |
|
onFlowLoaded | no |
| |
onFlowClosed | no |
| |
onFlowFinalized | no |
| |
onStepLoaded | no |
| |
onStepCompleted | no |
| |
onRedirect | no |
| |
onUnauthorized | no |
|
Loading a specific variant revision
You can use query parameters to load a specific variant revision. Do not use this if you want to show the latest variant.
Last updated