You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@formsort/react-embed

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formsort/react-embed

Embed formsort flows in react components

1.2.0
Source
npm
Version published
Weekly downloads
2.9K
2.42%
Maintainers
2
Weekly downloads
 
Created
Source

@formsort/react-embed

Embed Formsort flows within react components

Installation

Add @formsort/react-embed to your project by executing npm install @formsort/react-embed or yarn add @formsort/react-embed.

Usage

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>
);
Events

You can add event listeners to flows like flowloaded, redirect etc. See all event listeners

Props
Prop nameDescriptionRequiredExample values
clientLabelclient nameyesformsort
flowLabelflow nameyesonboarding
variantLabelvariant namenomain
responderUuidresponder uuid to load existing answers fornoe4923baa-dc2d-4555-813c-a166952292fa
formsortEnvformsort integrations environment label, if not using productionnostaging
queryParamsadditional query params, to pre-populate answers in the formno[['name', 'Olivia']], ['age', '3']]
embedConfigconfig passed to the underlying FormsortWebEmbedno{ style: { height: '100%' } }
flowloadedevent listenerno() => { console.log('flow loaded') }
flowclosedevent listenerno() => { console.log('flow closed') }
flowfinalizedevent listenerno() => { console.log('flow finalized') }
redirectevent listenerno(url: string) => { console.log('redirecting to:', url) }

Testing

npm run test

Publishing

npm publish

Keywords

formsort

FAQs

Package last updated on 26 Mar 2020

Did you know?

Socket

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.

Install

Related posts