Follow this guide to add PaywallOS to your application.
npm install @paywallos/sdk # or pnpm add @paywallos/sdk yarn add @paywallos/sdk
Create a .env.local file:
NEXT_PUBLIC_PAYWALLOS_API_KEY=pk_live_... NEXT_PUBLIC_PAYWALLOS_APP_ID=app_...
Add the provider to your root layout or app component:
import { PaywallOSProvider } from '@paywallos/sdk'
export default function RootLayout({ children }) {
return (
<html>
<body>
<PaywallOSProvider
apiKey={process.env.NEXT_PUBLIC_PAYWALLOS_API_KEY}
appId={process.env.NEXT_PUBLIC_PAYWALLOS_APP_ID}
userId={user?.id} // Your user's ID
>
{children}
</PaywallOSProvider>
</body>
</html>
)
}Upload an OpenVerb JSON file in the dashboard:
{
"namespace": "myapp.core",
"version": "1.0.0",
"verbs": [
{
"name": "export_data",
"category": "file_system",
"description": "Export user data to CSV"
},
{
"name": "generate_report",
"category": "analysis",
"description": "Generate analytics report"
}
]
}💡 Tip: Use the AI Assistant in the dashboard to generate this automatically!
Add verb= to any element:
// Buttons <button verb="export_data"> Export to CSV </button> // Links <a href="/reports" verb="generate_report"> Generate Report </a> // Divs (entire sections) <div verb="premium_features"> <AdvancedDashboard /> </div>