Skip to content
Open
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
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Polar.sh Integration
POLAR_ACCESS_TOKEN=your_polar_access_token_here
POLAR_30SEC_PRODUCT_ID=your_30sec_product_id_here
POLAR_60SEC_PRODUCT_ID=your_60sec_product_id_here
POLAR_BOTTLEDROP_PRODUCT_ID=your_bottledrop_product_id_here
POLAR_CRATE_PRODUCT_ID=your_crate_product_id_here
POLAR_FULLBARREL_PRODUCT_ID=your_fullbarrel_product_id_here
POLAR_LABEL_PRODUCT_ID=your_label_product_id_here
POLAR_SUCCESS_URL=https://whiskey.fm/sponsor/success

# Optional: Set to "sandbox" for testing, "production" for live (defaults to production)
PUBLIC_POLAR_SERVER=production
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ test-results/

# macOS-specific files
.DS_Store

# AI settings
AGENTS.md

# generated collections
src/data/collections.generated.ts
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,45 @@ your `starpod.config.ts` and RSS feed:
- `/{episode-number}.html.md` - Alternative episode URL

No configuration needed - it just works!

## Polar.sh Checkout Integration

This site uses Polar.sh for sponsor checkout. To set it up:

1. **Get your Polar credentials:**
- Log in to your [Polar dashboard](https://polar.sh)
- Go to Settings → API to get your access token
- Create two products for your sponsorship packages (30-second and 60-second
ads)
- Note the product IDs from each product's page

2. **Configure environment variables:** Create a `.env` file in the root
directory with:

```env
POLAR_ACCESS_TOKEN=your_polar_access_token_here
POLAR_30SEC_PRODUCT_ID=your_30sec_product_id_here
POLAR_60SEC_PRODUCT_ID=your_60sec_product_id_here
POLAR_BOTTLEDROP_PRODUCT_ID=your_bottledrop_product_id_here
POLAR_CRATE_PRODUCT_ID=your_crate_product_id_here
POLAR_FULLBARREL_PRODUCT_ID=your_fullbarrel_product_id_here
POLAR_LABEL_PRODUCT_ID=your_label_product_id_here
POLAR_SUCCESS_URL=https://whiskey.fm/sponsor/success
```

3. **Test the integration:**
- For testing, you can set `PUBLIC_POLAR_SERVER=sandbox` in your `.env`
- Visit `/sponsor` and click on either sponsorship option
- You'll be redirected to Polar's checkout page
- After successful payment, users return to `/sponsor/success`

4. **Go live:**
- Remove `PUBLIC_POLAR_SERVER` or set it to `production`
- Ensure your product IDs are for production products
- Test with a real payment to confirm everything works

The integration uses the `@polar-sh/astro` package which provides:

- Server-side checkout session creation at `/api/checkout`
- Automatic tax compliance through Polar's Merchant of Record service
- Support for multiple products and dynamic pricing
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"dependencies": {
"@astrojs/preact": "^4.1.3",
"@astrojs/vercel": "^9.0.3",
"@polar-sh/astro": "^0.5.0",
"@preact/signals": "^2.3.2",
"@vercel/analytics": "^1.5.0",
"@vercel/speed-insights": "^1.2.0",
Expand All @@ -32,7 +33,8 @@
"preact": "^10.27.2",
"rss-to-json": "^2.1.1",
"schema-dts": "^1.1.5",
"valibot": "^1.1.0"
"valibot": "^1.1.0",
"zod": "^4.1.12"
},
"devDependencies": {
"@astrojs/check": "^0.9.6",
Expand All @@ -59,6 +61,7 @@
"prettier-plugin-tailwindcss": "^0.7.1",
"sharp": "^0.34.4",
"tailwindcss": "^4.1.16",
"tsx": "^4.21.0",
"typescript": "^5.9.3",
"vite": "^7.1.12",
"vitest": "^4.0.1"
Expand Down
Loading
Loading