Configuration

This page covers the core configuration surface after installation. The core configuration lives under bnomei.klub.* in site/config/config.php. Provider-specific settings are namespaced under bnomei.klub.providers.{provider}.

Minimal configuration

You need a license key, an active provider handler, and the config block for that provider.

<?php

$provider = 'paddle'; // change to your provider key (stripe, mollie, lemonsqueezy, chargebee, polar, paypal, paddle)
$providerClass = \Bnomei\Klub\Provider\PaddleProvider::class;

return [
  'bnomei.klub.license.key' => fn() => env('KLUB_LICENSE_KEY'),
  'bnomei.klub.provider.handler' => $providerClass,

  // Copy the required keys from the matching provider doc page:
  // docs/providers/{provider}.md
  'bnomei.klub.providers.' . $provider => [
    // ...
  ],
];

Provider selection

  • bnomei.klub.provider.handler sets the active provider class (global).
  • Stripe is the default handler, but you should set bnomei.klub.provider.handler explicitly to the provider you use.
  • Provider classes expose a static $name; custom providers should set it to the provider key used in bnomei.klub.providers.{provider}.
  • bnomei.klub.providers.{provider}.field sets the user field used to store provider data (defaults to the provider key).
  • bnomei.klub.providers.{provider}.handler registers custom providers.

Provider credentials and setup details live in the Providers section.

Provider option keys

Use bnomei.klub.providers.{provider} with the keys below.

ProviderRequired keysCommon optional keys
Stripesecret, webhookcheckout, metadata, webhook_tolerance, field
Chargebeeapi_key, sitewebhook_auth or webhook_secret, checkout, plans, field
Lemon Squeezysecret, store_id, webhook_secretcheckout, plans, test_mode, field
Paddlesecret, webhook_secretclient_token, environment, webhook_tolerance, proration_billing_mode, checkout, plans, field
Polarsecret, webhook_secretserver, organization/org_slug/org, webhook_tolerance, checkout, plans, field
PayPalclient_id, secret, webhook_idenvironment, cancel_behavior, checkout, plans, field
Molliesecretwebhook_secret, checkout, plans, field

Plans and products

Plan and product sources depend on the provider:

  • Stripe: plans/products are fetched from the Stripe API (cached).
  • Other built-in providers: plans come from bnomei.klub.providers.{provider}.plans or site()->content()->plans YAML. Products are derived from those plans and grouped by product_id, product, or productname.

Checkout metadata

You can attach metadata to checkout sessions with bnomei.klub.providers.{provider}.metadata. In the built-in checkout routes, this callback receives sanitized request data from the checkout POST.

<?php

$provider = 'paddle'; // change to your provider key

return [
  'bnomei.klub.providers.' . $provider . '.metadata' => function (array $requestData = []) {
    return [
      'kirby_user_id' => kirby()->user()?->id(),
      'campaign' => $requestData['campaign'] ?? null,
    ];
  },
];

Checkout option callbacks

bnomei.klub.providers.{provider}.checkout can be an array or closure. The closure receives (array $options, array $data).

  • $options is always present.
  • $data is only present when checkout data is passed as options['data'].
  • Built-in checkout routes do not pass data to checkout callbacks by default.

See Customizing checkout for provider-specific examples.

Core options

OptionDefaultPurpose
cache.*trueToggle internal caches (actions, gates, gravatar, magiclink, notifications, ratelimit, stats).
caching15Cache provider calls and derived gates (minutes).
csrftrueEnforce CSRF on state-changing routes.
captcha.currentcallbackRead captcha input from the request.
captcha.getcallbackRead captcha phrase from storage.
captcha.setcallbackGenerate captcha image + phrase.
captcha.removecallbackClear stored captcha phrase after validation.
crypto.encryptfalseEncrypt provider data on the user.
crypto.passwordcallbackstring
gates.handlerBnomei\Klub\ProviderGatesGates handler implementation. Field name is defined in ProviderGates::$field.
license.keycallbackstring
license.domainstringnull
members.createtrueAuto-create users on checkout return.
members.roles['member']Roles allowed for members (first is default).
progress.handlerBnomei\Klub\Provider\UserFieldProgressProgress handler implementation. Field name is defined in UserFieldProgress::$field.
provider.handlerBnomei\Klub\Provider\StripeProviderProvider class used to resolve the active provider.
ratelimit.enabledtrueEnable rate limiting on public routes.
ratelimit.limit30Requests per minute per IP.
turnstile.endpoint...Verification endpoint override.
turnstile.sitekeycallbackstring
turnstile.secretkeycallbackstring
loggernullCallback to return an optional PSR-3 logger instance



Kirby Klub is not affiliated with the developers of Kirby CMS. We are merely standing on the shoulder of giants.
© 2026 Bruno Meilick All rights reserved.