Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "polar",
"displayName": "Polar",
"version": "0.2.0",
"version": "0.2.1",
"description": "Add Polar payments, subscriptions and usage billing to your app. Connects Claude to your Polar organization through the Polar MCP server and adds skills for setup, integration, testing and migrating from other payment platforms.",
"author": {
"name": "Polar",
Expand Down
2 changes: 1 addition & 1 deletion .cursor-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "polar",
"displayName": "Polar",
"version": "0.2.0",
"version": "0.2.1",
"description": "Add Polar payments, subscriptions and usage billing to your app. Connects Cursor to your Polar organization through the Polar MCP server and adds skills for setup, integration, testing and migrating from other payment platforms.",
"author": {
"name": "Polar"
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@ jobs:
brew install --cask antigravity-cli
agy --version
- run: |
report=$(agy plugin validate . --strict --json)
report=$(agy plugin validate . --json) || true
echo "$report"
servers=$(jq '.mcpServers | length' mcp_config.json)
skills=$(ls skills | wc -l | tr -d ' ')
echo "$report" | jq -e --argjson servers "$servers" --argjson skills "$skills" \
'.components.mcpServers == $servers and .components.skills == $skills and (.findings | length) == 0'
echo "$report" | jq -e --argjson servers "$servers" --argjson skills "$skills" '
.components.mcpServers == $servers and .components.skills == $skills and
([.findings[] | select(.severity != "note" and (.severity == "warning" and .file == ".mcp.json" | not))] | length) == 0
'
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.2.1

- Point access token instructions at the dashboard's new Settings → Access Tokens page in `polar-integration`, `polar-testing` and `setup-polar`.
- Offer `polar auth token` as a way to create the access token in the same skills.

## 0.2.0

- Update the skills to `@polar-sh/sdk` 1.x
Expand Down
2 changes: 1 addition & 1 deletion gemini-extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polar",
"version": "0.2.0",
"version": "0.2.1",
"description": "Add Polar payments, subscriptions and usage billing to your app. Connects to your Polar organization through the Polar MCP server and adds skills for setup, Checkout and webhook integration, and sandbox testing.",
"mcpServers": {
"polar": {
Expand Down
2 changes: 1 addition & 1 deletion openai/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polar",
"version": "0.2.0",
"version": "0.2.1",
"description": "Add Polar payments, subscriptions and usage billing to your app. Connects to your Polar organization and adds skills for setup, integration, testing and migrating from other payment platforms.",
"author": {
"name": "Polar",
Expand Down
3 changes: 2 additions & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "polar",
"description": "Add Polar payments, subscriptions and usage billing to your app. Connects to your Polar organization through the Polar MCP server and adds skills for setup, Checkout and webhook integration, and sandbox testing."
"description": "Add Polar payments, subscriptions and usage billing to your app. Connects to your Polar organization through the Polar MCP server and adds skills for setup, Checkout and webhook integration, and sandbox testing.",
"logo": "assets/polar_logomark_black.png"
}
2 changes: 1 addition & 1 deletion skills/polar-integration/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Don't install the deprecated `@polar-sh/<framework>` adapters (`@polar-sh/expres

Required environment variables (use whatever loader your framework provides — `process.env`, `Deno.env`, `import.meta.env`, etc.):

- `POLAR_ACCESS_TOKEN` — organization access token from the Polar dashboard (Settings → Developers).
- `POLAR_ACCESS_TOKEN` — organization access token. Create it with the Polar CLI (`polar auth token --scope checkouts:write --scope customer_sessions:write`, which opens a browser and prints the token, so ask the user to run it and save the output to the env file) or in the Polar dashboard (Settings → Access Tokens).
- `POLAR_WEBHOOK_SECRET` — only needed for the webhook recipe.
- `POLAR_ENVIRONMENT` — `sandbox` while developing; omit it or set `production` in production. Sandbox and production are separate, so each needs its own token.

Expand Down
2 changes: 1 addition & 1 deletion skills/polar-testing/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The sandbox is completely isolated from production. You need separate:
1. Go to https://sandbox.polar.sh/start
2. Create a new account (or use "Go to sandbox" from org switcher)
3. Create a test organization
4. Generate an access token in Settings → Developers
4. Generate an access token in Settings → Access Tokens, or with `polar auth token` once the CLI is signed in to the sandbox (see "Install and sign in" below)

### SDK Configuration

Expand Down
15 changes: 13 additions & 2 deletions skills/setup-polar/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,29 @@ Hand off to the `polar-integration` skill to generate the Checkout, Customer Por
Before invoking it, make sure the user has these environment variables ready (use whatever loader their framework provides):

```bash
POLAR_ACCESS_TOKEN= # organization access token: Settings → Developers → New Token, in the sandbox or production dashboard
POLAR_ACCESS_TOKEN= # organization access token, created below
POLAR_WEBHOOK_SECRET= # created in Step 7
POLAR_ENVIRONMENT=sandbox # omit or set to "production" when going live
```

The quickest way to create the access token is the Polar CLI. Install it with `npm install -g @polar-sh/cli`, then ask the user to run:

```bash
polar auth login --sandbox
token=$(polar auth token --scope checkouts:write --scope customer_sessions:write) && echo "POLAR_ACCESS_TOKEN=$token" >> .env
```

`polar auth token` opens the token page in a browser with those scopes preselected, waits for the user to create the token, and prints it, so this saves it to `.env` without showing it. The token belongs to the active organization and its environment: `polar auth whoami --json` shows which one that is, and `polar auth org` changes it.

Without the CLI, create the token in the sandbox or production dashboard: Settings → Access Tokens → Create token.

Pass along the product ID from Step 5 so checkout links can be tested in Step 8.

### Step 7: Set Up Webhooks

Start the dev server, then follow `polar-testing` ("Local Webhook Testing") to forward webhooks to it with the Polar CLI. It needs no tunnel and no dashboard endpoint:

1. Install the CLI and ask the user to run `polar auth login --sandbox`, which opens a browser.
1. If you skipped it in Step 6, install the CLI and ask the user to run `polar auth login --sandbox`, which opens a browser.
2. Save the local signing secret to `.env` with `polar webhook listen --print-secret`, then restart the dev server.
3. Start `polar webhook listen <port>/<webhook-path>` in the background, using the path from the route generated in Step 6. Pass `--org <id from Step 4>` if the account has several organizations.
4. Run `polar webhook trigger order.paid`. Success is exit 0 with a `Response 2xx` line. On a failure it prints the handler's response and exits with status 1; fix the handler and repeat. If it only says the event was forwarded by your `polar webhook listen` terminal, check the `listen` output.
Expand Down
Loading