getMonetization
Client function: read a site's monetization (paywall) configuration.
import { getMonetization } from 'flowstack-sdk'Non-React client function. GET /billing/app-access/monetization/{siteId}.
Signature
getMonetization(credentials, siteId, config?): Promise<ApiResponse<{ site_id: string; monetization: Monetization }>>Parameters
| Param | Type | Notes | Description |
|---|---|---|---|
credentials | FlowstackCredentials | required | The app owner's credentials (owner-scoped JWT). |
siteId | string | required | The site/app id to operate on. |
config | FlowstackClientConfig | since 0.2.6 | Client config (baseUrl, appScope, tenantId as needed). |
Returns
| Field | Type | Description |
|---|---|---|
| — | Promise<ApiResponse<{ site_id: string; monetization: Monetization }>> | The stored Monetization config for the app. |
Examples
Read monetization
const res = await getMonetization(credentials, siteId, { appScope });
if (res.ok) console.log(res.data.monetization.enabled);WarningOwner/management operation — call it with the app owner's credentials from a builder/dashboard/server context, not from inside the generated app's end-user runtime.
builtAppSafe is false.See also
setMonetization · Monetization
Source: src/api/client.ts (App Monetization, P0-155) · Also available in llms-full.txt and registry.json.