Skip to content
  • Workflows
  • Bindings

kinde.plan

The kinde.plan binding provides methods to use for various plan related events such as when a customer requests to cancel or change their plan.

Available in workflows

Link to this section
export const workflowSettings = {
// ...other settings
bindings: {"kinde.plan": {}}
};

denySelection(reason: string, suggestions: string[]): void

Link to this section

Prevent the user from changing their plan.

Link to this section

The Kinde infrastructure library provides a type-safe helper:

import { denyPlanSelection } from "@kinde/infrastructure";
export default async function (event: onPlanSelectionEvent) {
if (!canChangePlan()) {
denyPlanSelection("You are not allowed to change your plan as you have outstanding payments");
}
}

Using the low-level API

Link to this section

If you’re not using the infrastructure library, you can call the underlying API directly:

kinde.plan.denySelection(
"You are not allowed to change your plan as you have outstanding payments"
);

denyCancellation(reason: string): void

Link to this section

Prevent the user from cancelling their plan.

Link to this section

The Kinde infrastructure library provides a type-safe helper:

import { denyPlanCancellation } from "@kinde/infrastructure";
export default async function (event: onPlanCancellationRequestEvent) {
if (!canChangePlan()) {
denyPlanCancellation("You are not allowed to change your plan as you have outstanding payments");
}
}

Using the low-level API

Link to this section

If you’re not using the infrastructure library, you can call the underlying API directly:

kinde.plan.denyCancellation(
"You are not allowed to cancel your plan as you have outstanding payments"
);