Overview
The Credits Balance widget displays a customer’s current prepaid credit balance. It provides visibility into how many credits remain in the account, and includes an Add credits call-to-action button for prompting customers to top up their balance.Layout
The Credit balance widget displays the customer’s current available credit amount in a clear and prominent format. The layout includes the following elements:- The customer’s current credit balance in tokens (or other configured unit).
- The balance updates in real time after purchases or top-ups.
- An Add credits CTA button for prompting customers to top up their balance.

Add credits
The Add credits button is shown automatically when both of the following conditions are met:- Credit top-ups are allowed for the customer’s account.
- The customer’s current plan includes add-ons that can grant additional credits.

onAddCredits prop to hook into the button click, for example to open a custom modal, trigger analytics, or redirect to a dedicated top-up page:
Customization
Custom CSS
The widget styling can be customized by applying custom CSS using code. Below you can find a list of the supported CSS classes:Main container classes
Content classes
CTA button classes
Snippet
Props
Callback invoked when the Add credits button is clicked. Receives the current
CreditEntitlement object. Use this to open a checkout flow, a modal, or redirect the customer to a top-up page.