/api/openverb/checkCheck if a user has access to perform a specific verb action.
{
"verbId": "export_data",
"actor": { "type": "user", "id": "user_123" },
"context": { "tenantId": "app_456", "planId": "pro" }
}{
"ok": true,
"receipt": {
"executionId": "...",
"verbId": "export_data",
"status": "ok",
"actorId": "user_123",
"tenantId": "app_456"
}
}{
"denied": true,
"reason": {
"code": "tier_required",
"message": "Upgrade to Pro"
},
"upsell": {
"suggestedPlanId": "pro",
"cta": "Upgrade Now"
}
}/api/openverb/libraryRetrieve the complete OpenVerb library for your app.
?appId=app_456
{
"namespace": "myapp.core",
"version": "1.0.0",
"verbs": [
{
"id": "verb_789",
"name": "export_data",
"category": "file_system",
"description": "Export user data to CSV"
}
]
}/api/openverb/entitlementsGet all verbs a user is entitled to access based on their tier.
?userId=user_123&appId=app_456
{
"userId": "user_123",
"tier": "pro",
"entitlements": [
{
"verbId": "export_data",
"verbName": "export_data",
"usageLimit": {
"limit": 100,
"used": 45,
"period": "monthly"
}
}
]
}All API requests require authentication using your API key in the Authorization header:
Authorization: Bearer pk_live_...
Copy lib/paywall-sdk.ts from the PaywallOS repo. It provides initPaywallOS and usePaywallOS:
import { initPaywallOS, usePaywallOS } from '@/lib/paywall-sdk'
// One-time init (scans DOM for verb= attributes)
initPaywallOS(apiKey, appId, userId, userTier)
// Or use the hook for programmatic checks
const { checkVerb } = usePaywallOS(apiKey, appId, userId, userTier)
const response = await checkVerb('export_data')
if (response.ok) { /* allowed */ }
else if (response.denied) { /* response.reason?.message */ }