---
title: "Customize the pricing page"
description: "The server-rendered /pricing page and <PricingTable>: live plans with a monthly and yearly switch, the free plan, prices in the visitor's currency, credit packs compared per credit, a contact card, retired plans, the copy in app config, slots, events and the page's meta tags."
canonical_url: "https://nuxt-backend.dev/docs/build/billing/pricing-page"
---
# Customize the pricing page

> The server-rendered /pricing page and <PricingTable>: live plans with a monthly and yearly switch, the free plan, prices in the visitor's currency, credit packs compared per credit, a contact card, retired plans, the copy in app config, slots, events and the page's meta tags.

Version: nuxt-backend 0.6.x · Tab: Build · Kind: how-to · Status: stable

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

- [Try it live in the playground](https://nuxt-backend.dev/playground/pricing)
- [API reference](https://nuxt-backend.dev/docs/reference/api/use-pricing)
- [Source](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/components/billing/PricingTable.vue)

The module mounts a public pricing page at `/pricing` (module option `pages.pricing`). It renders `<PricingTable>` on the server: the plans, prices, trials and credits are in the HTML a visitor or a crawler receives, read from the scaffolded `getPricing` query, and stay live after hydration.

- **Polar does natively:** products with live prices in many currencies, hosted checkout, and checkout links (checked on 2026-10-25).
- **The package adds:** a server-rendered page and component over the live products, the monthly and yearly switch, the visitor's currency, packs compared per credit, a promotion's real terms, and the subscriber's own plan state.

Nothing on the page is a copy of a price. A new plan, pack or price in the catalog shows after `npx nuxt-backend billing sync`, and so does a changed trial. A price or a credit grant on a product that exists already is never rewritten by the sync, which reports the catalog's figure as drift: change it in the provider dashboard, and the page follows within seconds.

<demo-pricing>

## What it shows

- **Plans**, in catalog order or yours, each with its name, its price at the chosen interval, its trial, the credits it grants per cycle and its features.
- **The free plan**, when the catalog has one, with its [welcome credits](https://nuxt-backend.dev/docs/build/billing/catalog#welcome-credits) ("8 credits to start", the `pricing.welcome` label): marked current while the workspace is on it, with no button (a checkout of another plan upgrades it), and "Yours again when your plan ends" for a paid subscriber. A visitor reads "Sign up for free".
- **A monthly / yearly switch** when a plan is priced at both, saying what the year saves. Plans priced at one interval keep showing that price.
- **A currency switch** when the catalog prices in more than one currency: see [Currencies](#currencies).
- **Credit packs**, each with its credits, its price per credit, how much less that is than the costliest pack, and a "Best value" mark on the cheapest.
- **A contact card** after the plans, when you configure one.
- For a signed-in customer, the state of their plan: the current plan, upgrade or downgrade (by price per month, whichever interval either is billed at), a switch to the other interval of their own plan, and a one-step cancel. A switch first says what it does, in one group under the card: the price it moves to, when it happens and how the period settles, then **Confirm switch** ([A switch says what it does first](https://nuxt-backend.dev/docs/build/billing/subscriptions#a-switch-says-what-it-does-first)). The price it states is in the subscription's own currency, whatever the page shows, and a plan with no price in it offers no switch. A gifted plan's holder confirms too, and then checks the new plan out. A switch from yearly to monthly waits for the paid year's end, since the year's credits were granted at its start: the monthly card then says when it starts.
- A price archived in the provider dashboard, and a [retired plan](#retired-plans), show only to the people on them.

With `discount="launch"`, or a campaign link's code, the table shows a catalog [promotion](https://nuxt-backend.dev/docs/build/growth/offers) on each price it applies to: what it takes off, for how long, the regular price after it and its real end date, never a countdown; subscribing there checks out with it. A paying subscriber reads none, since a plan change takes no discount. The promotion shows from its start to its end by the server's clock, the moment the page rendered there, while the browser hydrates the page from its payload, so the HTML and the hydrated page agree on it. Once the page is on screen it runs by the browser's clock, and a return to the page without a reload reads the time it is entered at: a promotion that ended since shows no more, and one that started since shows.

The address picks what shows: `?interval=year` opens the yearly prices when a plan sells at them, and `?plan=pro`, as `<UpgradePrompt>` links to it, marks that card (`data-requested`) and brings it into view, at once when the visitor asks for reduced motion.

While billing is [not launched](https://nuxt-backend.dev/docs/build/billing/setup#before-billing-launches) on a production deployment, the table reads "Plans open soon" (the `pricing.soon` label) in a polite status, with no plan, pack or switch: its `soon` slot replaces it with your own, a waitlist link say.

A visitor who is signed out gets a sign-in link that returns to the address they were on, query included, so a [campaign link](https://nuxt-backend.dev/docs/build/growth/offers/campaign-links)'s discount and UTM survive the sign-in. A campaign's code the provider refuses (expired, used up) never blocks a purchase: the table opens the checkout without it.

## The copy in app config

Names and prices come from billing; the words around them are yours, in `app.config.ts`:

```ts [app.config.ts]
export default defineAppConfig({
  backend: {
    billing: {
      plans: [
        { key: 'starter', blurb: 'For trying things out.' },
        { key: 'pro', blurb: 'For products finding their feet.', features: ['Priority support', 'SSO'], highlight: true },
      ],
      packs: [{ key: 'credits100' }, { key: 'credits500', blurb: 'Most popular.' }],
      contact: {
        name: 'Enterprise',
        blurb: 'Custom limits and invoice billing.',
        features: ['Volume pricing', 'A named contact'],
        href: 'mailto:sales@example.com',
        label: 'Talk to sales',
      },
    },
  },
})
```

`plans` and `packs` choose which cards show and in which order, by catalog key; leave them empty and every plan and pack on sale shows, in catalog order. A plan's `features` replace the names of its feature benefits on its card. Every key is listed on [Change copy and labels](https://nuxt-backend.dev/docs/build/ui/customize/labels#the-full-shape).

## Monthly and yearly

The switch is a radio group under a legend, so the arrow keys move between the two options and a screen reader announces the choice. Bind it to show a chosen interval, or to read which one a visitor picked:

```vue [pages/plans.vue]
<script setup lang="ts">
const interval = ref<'month' | 'year'>('year')
</script>

<template>
  <PricingTable v-model:interval="interval" />
</template>
```

The yearly option says "Save N%", the most any plan saves; each yearly card says its own. The figure compares the yearly price with twelve monthly ones of the same plan and currency, rounded down.

## Currencies

When the [catalog prices in several currencies](https://nuxt-backend.dev/docs/build/billing/catalog#currencies), the table shows every price in the visitor's, and a **Currency** select of the ones every plan and pack on sale is priced in, each named in the reader's language. The currency is, in order:

1. the `currency` option of `usePricing()` (a page that knows it);
2. the visitor's pick in the select, for the rest of the visit;
3. a `?currency=eur` in the address, so a link can open the page in euros;
4. the visitor's own: the country their request comes from (the `x-vercel-ip-country` or `cf-ipcountry` header), else the region of the app's active language (`@nuxtjs/i18n`'s), else of the language their browser weighs highest. It is read on the server, so the page arrives priced in it.

A currency the catalog does not price shows the catalog's own. The table never mixes currencies: when a plan or pack is not priced in the one asked for, every card shows one that all of them are priced in, the catalog's own first (a free plan, free in any currency, counts for none). Only a catalog with no currency in common shows each card in its own. Every checkout and top-up from the table pays in the currency its card shows, at the provider's native price in it. A catalog priced in one currency names none, and the provider's own stands. Nothing is stored on the device.

The guess is the request's, so a page served from a cache (`routeRules` with `swr` or `isr`) or prerendered carries the currency of the request that rendered it to every visitor. On such a page, render `<PricingTable>` in the browser (inside `<ClientOnly>`), read your own pricing with `usePricing({ server: false })`, or pass `usePricing({ currency })` where the page knows it.

The checkout forwards the visitor's IP to Polar, so the currency Polar charges in matches the one the page shows, even though the checkout is created on the server ([Local prices and consent proof](https://nuxt-backend.dev/docs/build/billing/subscriptions/checkout#local-prices-and-consent-proof)).

## Where a checkout returns

A checkout returns to the pricing page by default. `successUrl` sends each kind elsewhere, by a path on the site, a full URL on its origin, or a function of what was bought:

```vue [pages/pricing.vue]
<template>
  <PricingTable :success-url="{ plan: plan => `/welcome?plan=${plan.key}`, pack: '/credits' }" />
</template>
```

`usePricing({ successUrl })` takes the same shape: `bind.planAction`'s checkout returns there, and `successUrlFor('plan', key)` or `successUrlFor('pack', key)` answers the absolute URL for a checkout of your own.

## A contact card

`appConfig.backend.billing.contact`, or the `contact` prop, adds a card after the plans with a link instead of a checkout: for an enterprise tier, a custom quote, a call. `:contact="null"` hides the configured one on one table. Its button reads `label`, else the `pricing.contact` label.

## Retired plans

A [retired plan](https://nuxt-backend.dev/docs/build/billing/catalog#retire-a-plan) shows only to the people subscribed to it, marked "No longer offered", at the interval they pay, with their cancel button. Nobody else sees it, and nobody can switch to it.

## Packs and the best value

Every figure comes from the pack's live product: its price, and the units of its credit benefit. A pack is compared only with packs on the same meter and currency, and only when it has one credit benefit, a price above zero and credits that roll over. The wording is objective by default; to call the difference a bonus, override `pricing.lessPerCredit` (it receives `{percent}`).

## Slots, events and hooks

Every region has a slot, each receiving the table's context (`plans`, `packs`, `interval`, `setInterval`, `currency`, `currencies`, `setCurrency`, `contact`, `subscribe`, `switchTo`, `buyPack` and the rest): `header`, `interval`, `currency`, `loading`, `empty`, `soon`, `plan`, `plan-action`, `contact`, `packs`, `pack`, `portal`, `error` and `footer`. The table emits `update:interval`, `checkout`, `plan-changed`, `canceled`, `uncanceled`, `topped-up` and `error`. Markup carries `data-pricing` hooks for styling: a plan card is `[data-pricing="plan"]` with `data-interval`, `data-current`, `data-retired`, `data-free` and `data-highlight`; the currency switch is `[data-pricing="currency"]` (its slot is `currency`); its button's `data-intent` is `subscribe`, `upgrade`, `downgrade`, `switch`, `cancel`, `uncancel` or `sign-in`, and `[data-pricing="plan-scheduled"]` replaces it on the price a scheduled change moves to; a pack is `[data-pricing="pack"]` with `data-best-value`. The full list of slots and props is on [Billing components](https://nuxt-backend.dev/docs/reference/components/billing).

## A page of your own

`usePricing()` returns what the table reads: `plans`, `packs`, the `intervals` on sale, the `interval` shown (the address's `?interval=` first), the `currency` the prices are in with every one of the `currencies` and `setCurrency`, `packFor(units)`, the pack to offer someone short of credits, `welcome`, the free plan's welcome credits, `activePromotion`, the promotion asked for while it runs (by the server's clock while the page hydrates, then the browser's), `requested`, the plan a `?plan=` link asks for, `successUrlFor(kind, key)`, and `launched`, `false` while billing is not launched (hide your own pricing and gift links on it). It is rendered on the server too.

`checkout('plan', key)` and `checkout('pack', key)` check out the way the table's buttons do: a plan at the price its card shows (the `interval` shown), with the address's campaign (`useCampaign`), the promotion the pricing shows (`discount`) in the place of the campaign link's code on a price it is offered on, one discount per checkout, and once more without it when Polar refuses it, so a dead code never blocks the purchase. It pays in the price's currency where the catalog prices more than one, returns where `successUrl` says, and opens in this tab; options of your own go over its, `{ redirect: false }` or `emailOptOut` among them:

```vue [pages/pricing.vue]
<script setup lang="ts">
// A campaign link's code, else the catalog's launch promotion.
const { discountCode } = useCampaign()
const pricing = usePricing({ discount: () => discountCode.value ?? 'launch' })
const { isSubscribed, pass } = useBilling()
const change = usePlanChange({ pricing })
</script>

<template>
  <article v-for="plan in pricing.plans.value?.filter(plan => !plan.retired && !plan.free)" :key="plan.key">
    <h2>{{ plan.name }}</h2>
    <p v-if="plan.prices.month">
      {{ formatBillingAmount(plan.prices.month.amount, plan.prices.month.currency) }} a month
    </p>
    <!-- A subscriber switches, after reading what the switch does; anyone else checks out. -->
    <button v-if="isSubscribed && change.targetFor(plan.key, 'month')" @click="change.open(change.targetFor(plan.key, 'month')!)">
      Switch to {{ plan.name }}
    </button>
    <button v-else-if="!isSubscribed || pass" @click="pricing.checkout('plan', plan.key)">
      Subscribe
    </button>
  </article>
  <div v-if="change.target.value" role="group" :aria-label="change.title.value">
    <p>{{ change.when.value }}</p>
    <button @click="change.confirm()">Confirm switch</button>
    <button @click="change.close()">Not now</button>
  </div>
</template>
```

A subscriber's switch is a plan change, not a checkout. `usePlanChange({ pricing })` prices it in the subscription's own currency, which Polar keeps, offers none to a plan with no price in it or to the price a scheduled change moves to (`scheduledFor` says when that one starts), and says what it does before `confirm()` makes it with `proration: 'invoice'`: see [A switch says what it does first](https://nuxt-backend.dev/docs/build/billing/subscriptions#a-switch-says-what-it-does-first).

`formatBillingAmount(amount, currency, locale?)` writes a price the way the provider states it, an integer in the currency's smallest unit, by the digits the provider states that currency in: `1999` USD is $19.99, `500000` HUF is HUF 5,000 (hundredths, though the forint is written without decimals), `1999` JPY is ¥1,999. A whole amount shows no decimals, and any other every digit of the currency's smallest unit (`500050` HUF is HUF 5,000.50), the same on every runtime. It writes it in `locale`, else the active `@nuxtjs/i18n` locale, else English, never the visitor's own, so the server's render and the browser's agree. It is auto-imported.

A page of yours at `/pricing` replaces the module's ([Replace a page](https://nuxt-backend.dev/docs/build/ui/customize/parts#replace-a-page)).

## Meta tags and search

The page's title is the `pricing.title` label and its meta description the `pricing.description` label: override both in `appConfig.backend.labels.pricing`, or translate them. With an SEO module installed (`@nuxtjs/seo`, `nuxt-schema-org` or `nuxt-seo-utils`), the page also carries Open Graph tags and its plans and packs as schema.org `Product` data, one `Offer` per price with its billing period. Without one it adds neither. A page of your own gets the same data from `usePricing().structuredData`, each price in the currency's main unit with its own digits:

```ts [pages/pricing.vue]
const { structuredData } = usePricing()
useHead({ script: [{ type: 'application/ld+json', innerHTML: () => structuredData.value ?? '' }] })
```

## What happens when…

- **Billing is not launched on production.** The page reads "Plans open soon", and a checkout from anywhere is refused as `unavailable` (reason `not_launched`) ([Before billing launches](https://nuxt-backend.dev/docs/build/billing/setup#before-billing-launches)).
- **The products table is empty.** The page shows no plans: run `npx convex run billing:syncProducts` once, or `billing sync` again.
- **A campaign's code is refused by Polar.** The checkout opens without it; a purchase is never blocked by a dead code.
- **A member doesn't manage billing.** The cards show without buttons, and a note says who does.
- **The visitor's currency isn't priced.** The catalog's own currency shows.
- **A checkout is refused.** The table emits `error` with the refusal, and its `error` slot shows it ([Open checkout and the portal](https://nuxt-backend.dev/docs/build/billing/subscriptions/checkout#what-happens-when)).

## Limits

- **Live prices only.** The page never shows a price Polar does not hold, and a sync never rewrites a held price.
- **One promotion at a time.** The table shows the one discount a checkout would apply.
- **Cached pages carry one currency.** A page served from a cache shows every visitor the currency of the request that rendered it.

## Test it

The table reads `getPricing` and the subscription, so a mock renders any visitor's view. [Test pages over a mock backend](https://nuxt-backend.dev/docs/develop/testing/pages) has a full example that cancels a plan from the table; this one checks a visitor's buttons:

```ts [test/app/pricing.test.ts]
import { mountSuspended } from '@nuxt/test-utils/runtime'
import { createBackendMock, resetBackendMock } from 'nuxt-backend/test-utils'
import { afterEach, expect, test } from 'vitest'
import { PricingTable } from '#components'

afterEach(() => resetBackendMock())

test('a signed-out visitor is asked to sign in, not to pay', async () => {
  const backend = createBackendMock({
    queries: {
      'billing:getPricing': {
        plans: [{ key: 'creator', name: 'Creator', description: null, retired: false, features: [], featureKeys: [], prices: { month: { productId: 'prod_creator', amount: 1200, currency: 'usd', monthly: 1200 } } }],
        packs: [],
      },
    },
  })
  backend.signOut()
  const table = await mountSuspended(PricingTable)
  expect(table.find('[data-intent="sign-in"]').exists()).toBe(true)
})
```

## Related

- [Polar](https://nuxt-backend.dev/docs/services/polar): products, currencies and the sandbox.
- [Define and sync your catalog](https://nuxt-backend.dev/docs/build/billing/catalog): prices per interval and currency, the free plan, trials and retired plans.
- [Run a promotion](https://nuxt-backend.dev/docs/build/growth/offers): a catalog discount the table shows and checks out with.
- [Share campaign links](https://nuxt-backend.dev/docs/build/growth/offers/campaign-links): discount codes and UTM attribution into checkout.
- [Open checkout and the portal](https://nuxt-backend.dev/docs/build/billing/subscriptions/checkout): what the buttons call.

</demo-pricing>


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
