Creem
Connect Creem products and complete a test purchase in your app
Use Creem to sell subscriptions or a one-time plan. Prepare your test products, connect the callback, and purchase a plan from Account → Upgrade.
The source-code purchase link on the public pricing page is configured separately under Source Code Checkout in admin settings.
Before you start
Complete login and admin setup and migrate D1. Prepare a Creem account and start in test mode.
1. Add credentials
Create an API Key in the developer settings of Creem Dashboard and copy it to .dev.vars:
CREEM_X_API_KEY=your-test-api-key
CREEM_TEST_MODE=trueSet keys in .dev.vars locally and Worker secrets online. The admin area shows their status. You can also choose the payment provider and test mode there, unless an environment variable locks the setting.
2. Configure products
Create monthly, yearly, or one-time products in Creem test mode and record each Product ID. Keep VITE_APP_URL=http://localhost:3377 in .env for local development.
You can ask your AI coding tool to make the plan changes:
Update the existing plans in
src/config/payment-config.tsfor Creem. Replace the default Stripe price references with my Creem Product IDs and match each amount and billing interval. Keep USD for the first test; 990 means $9.90. Remove plans I do not offer.
Changing the provider in admin does not replace product IDs. Creem needs its own prod_... values in the priceId field.
3. Configure webhooks
Add your public callback URL in Creem Dashboard:
https://your-domain.com/api/payment/webhook/creemThe project handles these events. Configure the corresponding event options available in the dashboard:
checkout.completedsubscription.activesubscription.paidsubscription.canceledsubscription.pausedsubscription.update
Copy the webhook's signing secret to .dev.vars:
CREEM_WEBHOOK_SECRET=your-webhook-signing-secretLocal webhook delivery needs a public HTTPS address. You can use an existing tunnel forwarding to port 3377. Point the Creem webhook to its /api/payment/webhook/creem endpoint, update VITE_APP_URL in .env to that tunnel address, and restart the development server.
4. Verify payment
- Open Admin → Settings (
/admin/config), selectcreem, confirm test mode is enabled, and save. - Sign in with a test account that has no subscription. Open the avatar menu, choose Account → Upgrade, and purchase a configured plan.
- Complete Creem's test payment flow and confirm HTTP 200 in webhook delivery records.
- Open Admin → Orders (
/admin/orders) and check the paid order. Return to the homepage and check the plan in Account, plus the balance and Usage records if it grants credits.
If payment completes but the order stays unchanged, check test/live mode, Product ID, callback URL, and the matching signing secret.
Before accepting real payments
The default payment return pages still need to be completed before launch. Changing an existing subscription is also unfinished. Use a new account to test the first purchase, then give your AI coding tool the return-page task in the Stripe guide.
Go live
Use a live API Key, live Product IDs, and live Webhook Secret. Set CREEM_TEST_MODE=false. Set vars.VITE_APP_URL in wrangler.jsonc to your real domain (also used by production builds), then follow deployment to upload secrets and rebuild.
Next: configure credits.