Install Flows
Install the Flows SDK library via a NPM package manager.
npm i @flows/js
Create Flows component and initialize it with your project ID.
"use client";
import { init } from "@flows/js";
import { useEffect } from "react";
export const Flows = () => {
useEffect(() => {
init({
// Insert your Flows Cloud projectId
projectId: "xxxx",
});
}, []);
return null;
};
Lastly don't forget to render the Flows component in the root of your application (layout.tsx
or App.tsx
). When that's done, you can start creating onboarding flows and starting them in your product.
Ensure you use a secure origin (https://...
or http://localhost
) when using this library. We
use WebCrypto API under the hood, which requires a secure context. Learn
more (opens in a new tab).