# Chargebee.js

Chargebee.js is the client-side JavaScript library that connects your application to Chargebee. Use it to open Chargebee-hosted checkout and self-serve portal pages, collect payment details securely, render pricing tables, and run in-app offers and cancel flows.

This site is the API reference for the library. For conceptual guides, configuration steps, and integration walkthroughs, see Chargebee product documentation (opens new window) and Chargebee tutorials (opens new window).

# Get started

Add the library to your page and initialize it once:

<script src="https://js.chargebee.com/v2/chargebee.js"></script>
1
const chargebee = Chargebee.init({
  site: "YOUR-CHARGEBEE-BILLING-SUBDOMAIN"
});
1
2
3

See Set up Chargebee.js for the full setup, including custom domains and publishable keys.

# Tutorials

For step-by-step integration walkthroughs, see all Chargebee.js tutorials (opens new window).

# Reference

# Core

# Checkout and portal

# Payments

# Growth and conversion

# Utilities

  • Functions — EU VAT validation and other utility calls.