
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
@formsort/react-embed
Advanced tools
Embed Formsort flows within react components.
This is a handy wrapper around @formsort/web-embed-api.
Important note: This package is intended for use in React web applications. If you're looking to embed Formsort flows in React Native applications, please see React native embed guide.
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:
import React from 'react';
import EmbedFlow from '@formsort/react-embed';
const EmbedFlowExample: React.FunctionComponent = () => (
<div>
<EmbedFlow
clientLabel="formsort"
flowLabel="onboarding"
variantLabel="main"
embedConfig={{
style: {
width: '100%',
height: '100%',
},
}}
/>
</div>
);
You can add event listeners to flows like Flowloaded, redirect etc. See all event listeners
| Prop name | Description | Required | Example values |
|---|---|---|---|
| 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 | config passed to the underlying FormsortWebEmbed | no | { style: { height: '100%' } } |
| onFlowLoaded | event listener | no | () => { console.log('flow loaded') } |
| onFlowClosed | event listener | no | () => { console.log('flow closed') } |
| onFlowFinalized | event listener | no | () => { console.log('flow finalized') } |
| onStepLoaded | event listener | no | () => { console.log('step loaded') } |
| onStepCompleted | event listener | no | () => { console.log('step loaded') } |
| onRedirect | event listener | no | (url: string) => { console.log('redirecting to:', url) } |
| onUnauthorized | event listener | no | () => { console.log('ID token is missing or invalid.') } |
You can use query parameters to load a specific variant revision. Don't use it if you want to show latest variant.
import React from 'react';
import EmbedFlow from '@formsort/react-embed';
const EmbedFlowExample: React.FunctionComponent = () => (
<div>
<EmbedFlow
clientLabel="formsort"
flowLabel="onboarding"
variantLabel="main"
queryParams={['variantRevisionUuid', '<uuidv4>']}
/>
</div>
);
FAQs
Embed formsort flows in react components
The npm package @formsort/react-embed receives a total of 23,411 weekly downloads. As such, @formsort/react-embed popularity was classified as popular.
We found that @formsort/react-embed demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.