← Back to DocsQuick Start

Get Started in 5 Minutes

Follow this guide to add PaywallOS to your application.

1Install the SDK

npm install @paywallos/sdk

# or
pnpm add @paywallos/sdk
yarn add @paywallos/sdk

2Get Your API Keys

  1. Sign up at PaywallOS
  2. Create a new app in the dashboard
  3. Copy your API Key and App ID

3Add Environment Variables

Create a .env.local file:

NEXT_PUBLIC_PAYWALLOS_API_KEY=pk_live_...
NEXT_PUBLIC_PAYWALLOS_APP_ID=app_...

4Wrap Your 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>
  )
}

5Create Your Verb Library

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!

6Add Verb Attributes

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>

Done!

PaywallOS now automatically enforces access based on user tiers. No additional code needed!