Installation
Install with a package manager- npm
- yarn
- pnpm
Quick Usage
Step 1: Import the PlandalfProvider and usePlandalf
Step 2:
Start using theusePlandalf hook to access the Plandalf API
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
npm install @plandalf/plandalf-react-js
yarn add @plandalf/plandalf-react-js
pnpm add @plandalf/plandalf-react-js
import { PlandalfProvider } from "@plandalf/plandalf-react-js";
function App(props) {
return (
<PlandalfProvider agent={props.jwt_token}>
<MyApplication />
</PlandalfProvider>
)
}
usePlandalf hook to access the Plandalf API
import { usePlandalf } from "@plandalf/plandalf-react-js";
function MyApplication () {
const plandalf = usePlandalf();
if (plandalf.isWorkflowActive('my_workflow')) {
return <MyOldPaywall/>
}
return (
<MyComponent/>
)
}
