Skip to content
Closed
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
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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_SUCCESS_URL=https://whiskey.fm/sponsor/success

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

# macOS-specific files
.DS_Store

# AI settings
AGENTS.md
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,38 @@ see fit.

We use Turso and Astro DB to setup guests per episode. If you would also like to
do this, you will need a Turso account.

## 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_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
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
"test:unit": "vitest"
},
"dependencies": {
"@astrojs/db": "^0.18.1",
"@astrojs/preact": "^4.1.1",
"@astrojs/sitemap": "^3.6.0",
"@astrojs/vercel": "^8.2.11",
"@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,12 +35,11 @@
"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.5",
"@astrojs/db": "^0.18.1",
"@astrojs/sitemap": "^3.6.0",
"@eslint/js": "^9.38.0",
"@playwright/test": "^1.56.1",
"@tailwindcss/forms": "^0.5.10",
Expand Down
68 changes: 62 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified public/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/android-chrome-384x384.png
Binary file not shown.
Binary file added public/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/apple-touch-icon-120x120.png
Binary file not shown.
Binary file removed public/apple-touch-icon-152x152.png
Binary file not shown.
Binary file removed public/apple-touch-icon-180x180.png
Binary file not shown.
Binary file removed public/apple-touch-icon-60x60.png
Binary file not shown.
Binary file removed public/apple-touch-icon-76x76.png
Binary file not shown.
Binary file modified public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon.ico
Binary file not shown.
Binary file modified public/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading