monetization.isEnabled

API reference for the monetization.isEnabled method.

This API is only available to apps that have been accepted into the Premium Apps Program(opens in a new tab or window).

This API is strictly for UI-related checks and should not be used for backend authorization or verification purposes.

Usage: Check if a billable action is enabled

import { auth } from '@canva/user';
const isEnabled = await monetization.isEnabled('MY_BILLABLE_ACTION');
if (isEnabled) {
// Show premium UI elements
} else {
// Show upgrade prompt
}
TYPESCRIPT

Parameters

actionBillableAction
Required

The billable action to verify.

Available values:

  • "modify_image"
  • "modify_video"
  • "modify_audio"
  • "modify_text"
  • "import_image"
  • "import_video"
  • "import_audio"
  • "import_text"
  • "generate_image"
  • "generate_video"
  • "generate_audio"
  • "generate_text"

Returns

A promise that resolves to true if the action can be tracked (i.e., premium features are enabled for the user), or false if the action cannot be tracked (i.e., non-premium).

Promise<boolean>