React-embed
Embed Formsort flows within react components.
Last updated
Was this helpful?
Embed Formsort flows within react components.
Last updated
Was this helpful?
This is a handy wrapper around .
Add @formsort/react-embed
to your project by executing yarn add @formsort/react-embed
or npm install @formsort/react-embed
.
Here's an example of basic usage:
clientLabel
client name
yes
formsort
flowLabel
flow name
yes
onboarding
variantLabel
variant name
no
main
responderUuid
responder uuid to load existing answers for
no
e4923baa-dc2d-4555-813c-a166952292fa
formsortEnv
formsort integrations environment label, if not using production
no
staging
queryParams
additional query params, to pre-populate answers in the form
no
[['name', 'Olivia'], ['age', '3']]
embedConfig
no
{ style: { height: '100%' } }
onFlowLoaded
no
() => { console.log('flow loaded') }
onFlowClosed
no
() => { console.log('flow closed') }
onFlowFinalized
no
() => { console.log('flow finalized') }
onStepLoaded
no
() => { console.log('step loaded') }
onStepCompleted
no
() => { console.log('step loaded') }
onRedirect
no
(url: string) => { console.log('redirecting to:', url) }
onUnauthorized
no
() => { console.log('ID token is missing or invalid.') }
You can use query parameters to load a specific variant revision. Do not use this if you want to show the latest variant.
You can add event listeners to flows like Flowloaded
, redirect
etc. See .
config passed to the underlying