Docs / wallet / getMonetization

getMonetization

utilitysince 0.2.6not for built apps

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

ParamTypeNotesDescription
credentialsFlowstackCredentialsrequiredThe app owner's credentials (owner-scoped JWT).
siteIdstringrequiredThe site/app id to operate on.
configFlowstackClientConfigsince 0.2.6Client config (baseUrl, appScope, tenantId as needed).

Returns

FieldTypeDescription
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.