Skip to main content
Subcommands
  • polar config init Create a billing config file from your organization’s meters, benefits and products, and show what to do next
  • polar config validate Check a billing config file and show what saving it to the draft would change, without changing anything
  • polar config draft Save a billing config file to the draft catalog of your organization. Nothing changes for customers until you publish it
  • polar config publish Make your organization’s draft catalog live, so new checkouts sell its products, benefits and meters
  • polar config reset Rewrite your billing config file to match what is on Polar: the draft if there is one, the live catalog otherwise
  • polar config generate Write the names in a billing config (its meters, benefits, products and the events its meters count) to a file your application code imports. A misspelled name then fails in your type checker instead of at run time
  • polar config prune Remove unused deprecated entries from a billing config file, without changing anything on Polar
  • polar config disable Stop managing your catalog with config, so it can be edited in the dashboard again. Only possible until a publish replaces your live catalog

polar config init

Create a billing config file from your organization’s meters, benefits and products, and show what to do next
Arguments Flags Examples Write a config for the active organization at the root of your project
Set up your sandbox organization, logging in first if needed
Write a JSON config for another organization
Use the suggested external IDs for existing resources that have none, for scripts and agents
Choose the external ID of an existing resource; init —json lists the IDs that need one
Write to a specific path and print the result as JSON, for scripts and agents

polar config validate

Check a billing config file and show what saving it to the draft would change, without changing anything
Arguments Flags Examples Check polar.config.ts in the current directory
Check a specific file
Check against another organization, by slug or ID
Print the changes and issues as JSON
Also post the changes on the pull request being built, in GitHub Actions or Buildkite

polar config draft

Save a billing config file to the draft catalog of your organization. Nothing changes for customers until you publish it
Arguments Flags Examples Show what polar.config.ts would change, then save it to the draft after confirmation
Save a specific file
Save to another organization, by slug or ID
Save without asking, for scripts and CI
Name the draft catalog version
Save the file even when the draft has changes that are not in it
Print what was saved as JSON, for scripts and agents

polar config publish

Make your organization’s draft catalog live, so new checkouts sell its products, benefits and meters
Arguments Flags Examples Publish the draft after confirmation, warning about changes in polar.config.ts that the draft is missing
Publish the draft of another organization, by slug or ID
Name the catalog version when publishing it
Save and publish in one go, for scripts and CI

polar config reset

Rewrite your billing config file to match what is on Polar: the draft if there is one, the live catalog otherwise
Arguments Flags Examples Replace polar.config.ts with the draft on Polar, after confirmation
Reset a specific file
Reset from another organization without asking

polar config generate

Write the names in a billing config (its meters, benefits, products and the events its meters count) to a file your application code imports. A misspelled name then fails in your type checker instead of at run time
Arguments Flags Examples Write the names next to the config, in the language of the project
Choose where the file goes
Fail in CI when the generated file is out of date
Print what was written as JSON, for scripts and agents

polar config prune

Remove unused deprecated entries from a billing config file, without changing anything on Polar
Arguments Flags Examples List the deprecated entries in polar.config.ts and remove the unused ones after confirmation
Prune a specific file
Check usage in another organization, by slug or ID
Remove without asking and print the result as JSON

polar config disable

Stop managing your catalog with config, so it can be edited in the dashboard again. Only possible until a publish replaces your live catalog
Flags Examples Disable config after confirmation
Disable config for another organization without asking