Installation
Install ProposeFlow in your project using your preferred package manager.
Requirements
- ✓Node.js 18.0 or later
- ✓TypeScript 5.0 or later (recommended)
Install the SDK
The SDK is the main package for interacting with ProposeFlow.
npm
npm install @proposeflow/sdk zodpnpm
pnpm add @proposeflow/sdk zodyarn
yarn add @proposeflow/sdk zodReact Integration (Optional)
Building a React application? The optional React package provides hooks and components for displaying proposals and capturing user decisions. You can also build your own UI using just the SDK.
npm install @proposeflow/reactSee the React Integration guide for usage examples.
Environment Setup
Create a .env file in your project root and add your API key.
.env.local
# ProposeFlow API Key
# Get yours at https://proposeflow.dev/dashboard
PROPOSEFLOW_API_KEY=pf_live_xxxxxxxxxxxxSecurity note: Never expose your API key in client-side code. Always use server-side functions or API routes to call ProposeFlow.
TypeScript Configuration
ProposeFlow is written in TypeScript and ships with full type definitions. For the best experience, ensure your tsconfig.json includes:
tsconfig.json
{
"compilerOptions": {
"strict": true,
"moduleResolution": "bundler",
"target": "ES2022"
}
}