Skip to content

docs: Polar integration guide + setup-polar reference + CLI doc-drift fixes - #68

Merged
sonpiaz merged 2 commits into
mainfrom
docs/polar-setup
Jul 6, 2026
Merged

docs: Polar integration guide + setup-polar reference + CLI doc-drift fixes#68
sonpiaz merged 2 commits into
mainfrom
docs/polar-setup

Conversation

@sonpiaz

@sonpiaz sonpiaz commented Jul 6, 2026

Copy link
Copy Markdown
Member

What

Docs companion to Affitor/cli#24 (affitor setup polar + onboard Polar auto-inject).

  • New api-reference/integrations/polar.mdx — canonical Polar sale path: one-command setup, both attribution carriers (server-side checkout metadata and ?reference_id= checkout links), the generated webhook glue route, the camelCase SDK-payload contract note (reading total_amount off the parsed payload is undefined — the Uat #1 trap), renewals via billingReason === 'subscription_cycle', refunds, verify + common mistakes. Added to the Integrations nav after Stripe.
  • commands.mdx: new affitor setup polar section; onboard section updated for the Polar auto-inject path.
  • 3 runtime-verified doc-drift fixes in commands.mdx:
    • config sample cookie "_aff"affitor_click_id (the tracker's real cookie, affiliate-cms/public/js/affitor-tracker.js)
    • setup-stripe events table invoice.payment_succeededinvoice.paid (what the CLI actually registers, packages/cli/src/types.ts WEBHOOK_EVENTS)
    • config sample was the legacy v1 shape with an inline api_key → v2 shape, secrets documented in .affitor/.env; documented the real webhook ingest URL (/api/webhook-distributor/stripe)

Verification

  • npm run build green; /api-reference/integrations/polar present in the build output (both /docs and root routes).
  • Behavior documented runtime-first from affiliate-cli@feat/polar-setup + polar.sh/docs (verified 2026-07-05).

Notes

🤖 Generated with Claude Code

https://claude.ai/code/session_017mS1Kn4D45SX2wVaVmfwUE

sonpiaz and others added 2 commits July 5, 2026 19:14
…2 config shape

Three runtime-verified fixes:
- Config sample showed cookie name "_aff"; the tracker's runtime cookie is
  affitor_click_id (affiliate-cms/public/js/affitor-tracker.js).
- setup-stripe events table said invoice.payment_succeeded; the CLI
  registers invoice.paid (packages/cli/src/types.ts WEBHOOK_EVENTS).
- Config sample showed the legacy v1 shape with an inline api_key; the CLI
  writes v2 with secrets in .affitor/.env. Also document the real webhook
  ingest URL (/api/webhook-distributor/stripe).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017mS1Kn4D45SX2wVaVmfwUE
- New api-reference/integrations/polar.mdx — canonical Polar sale path:
  one-command setup, both attribution carriers (checkout metadata and
  ?reference_id= checkout links), the generated webhook glue route,
  camelCase SDK-payload contract note, renewals via billingReason,
  refunds, verify + common mistakes.
- commands.mdx: new `affitor setup polar` section; onboard section now
  reflects the Polar auto-inject path.
- Nav: integrations/polar after stripe.

Behavior documented from affiliate-cli feat/polar-setup (runtime-first)
+ polar.sh/docs verified 2026-07-05.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017mS1Kn4D45SX2wVaVmfwUE
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
affitor-docs Ready Ready Preview, Comment Jul 6, 2026 2:23am

Request Review

@sonpiaz
sonpiaz merged commit a9e6b31 into main Jul 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant