Codapult
ЦеныПлагиныДокументация
Codapult

SaaS-бойлерплейт для разработчиков

Продукт

  • Цены
  • Плагины
  • Документация

Компания

  • Контакты
  • GitHub

Правовая информация

  • Политика конфиденциальности
  • Условия использования

© 2026 Codapult. Все права защищены.

Все статьи

Getting Started

  • Introduction
  • Quick Start
  • Project Structure

Configuration

  • Environment Variables
  • App Configuration

Authentication

  • Authentication
  • OAuth Providers
  • Two-Factor & Passwordless
  • Enterprise SSO (SAML)

Database

  • Database
  • Migrations

Teams

  • Teams & Organizations
  • Permissions & RBAC

Payments

  • Payments & Billing
  • Stripe Setup
  • LemonSqueezy Setup
  • Polar Setup
  • Payment Webhooks

Api

  • API Layer
  • tRPC
  • GraphQL

Ai

  • AI Features

Email

  • Email
  • Email Templates

Infrastructure

  • Infrastructure
  • File Storage
  • Background Jobs

Ui

  • UI & Theming

I18n

  • Internationalization

Content Management

  • Content Management

Admin

  • Admin Panel

Security

  • Security

Monitoring

  • Analytics & Monitoring

Modules

  • Module Architecture

Plugins

  • Plugin System
  • AI Kit Plugin
  • CRM Plugin
  • Helpdesk Plugin
  • Email Marketing Plugin

Deployment

  • Deployment
  • Troubleshooting

Upgrading

  • Upgrading Codapult

Developer Tools

  • MCP Server
  • Testing
Payments

Polar Setup

Configure Polar as a payment provider with Merchant of Record and GitHub-native billing.

Polar is a Merchant of Record built for developers — it handles VAT, sales tax, and compliance globally while offering deep GitHub integration and low fees (4% + $0.40).

Setup

PAYMENT_PROVIDER="polar"
POLAR_ACCESS_TOKEN="your-access-token"
POLAR_WEBHOOK_SECRET="your-webhook-secret"

Get your access token from Polar Dashboard → Settings → Developers → Personal Access Tokens.

Comparison with Other Providers

FeatureStripeLemonSqueezyPolar
Tax handlingYou handle (or use Stripe Tax)Automatic (MoR)Automatic (MoR)
Multi-line checkoutYes (base plan + add-ons)Single productSingle product
Customer portalStripe-hosted portalLS-hosted portalPolar purchases page
Connect / marketplaceYes (Stripe Connect)Not supportedNot supported
GitHub integrationNoneNoneLicense keys, GitHub App
Fee structure2.9% + $0.305% + 50¢4% + $0.40
Payout regions47 countries45+ countries100+ countries (via Stripe)

Codapult's adapter normalizes all three providers behind the same interface, so your application code stays the same.

Webhook Setup

The Polar webhook endpoint is POST /api/webhooks/polar.

  1. Go to Polar Dashboard → Settings → Webhooks
  2. Click Add Endpoint
  3. Enter URL: https://your-app.com/api/webhooks/polar
  4. Set and save the webhook secret
  5. Subscribe to events: order.created, subscription.created, subscription.updated, subscription.revoked, refund.created

Polar follows the Standard Webhooks specification. The adapter uses validateEvent from @polar-sh/sdk/webhooks for signature verification.

Local Development

Use the Polar CLI to forward webhooks to your local server:

curl -fsSL https://polar.sh/install.sh | bash
polar listen http://localhost:3000/api/webhooks/polar

Product Configuration

Create your products in the Polar Dashboard, then map them to plan IDs via environment variables:

POLAR_PRODUCT_PRO_MONTHLY="prod_..."
POLAR_PRODUCT_PRO_YEARLY="prod_..."
POLAR_PRODUCT_ENTERPRISE_MONTHLY="prod_..."
POLAR_PRODUCT_ENTERPRISE_YEARLY="prod_..."

These are read in src/lib/payments/plans.ts and used by the adapter during checkout and webhook processing.

Limitations

  • No multi-line subscriptions — add-ons must be separate checkouts (same as LemonSqueezy)
  • No direct quantity updates — seat-based pricing changes require a new checkout
  • No pause/resume — Polar uses revoke (immediate cancel); revoked subscriptions cannot be resumed
  • Customer portal — redirects to polar.sh/purchases/subscriptions (no embedded portal)

Sandbox / Test Mode

Polar provides a sandbox environment for testing purchases, subscriptions, and refunds without real payments. Use the sandbox to trigger webhook events during development.

Environment Variables

VariableRequiredDescription
POLAR_ACCESS_TOKENYesPersonal Access Token from Polar
POLAR_WEBHOOK_SECRETYesWebhook signing secret

For the full Polar documentation, see docs.polar.sh.

LemonSqueezy SetupPayment Webhooks