-
Notifications
You must be signed in to change notification settings - Fork 7
feat: Astro example with Webhooks, Customer Portal and Checkout creation #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Astro example with Webhooks, Customer Portal and Checkout creation #13
Conversation
|
@devroy10 is attempting to deploy a commit to the polar-sh Team on Vercel. A member of the Team first needs to authorize it. |
|
@rishi-raj-jain ready for a review |
…rom dotenv to dotenvx
|
@rishi-raj-jain requested changes have been applied, review when you can |
rishi-raj-jain
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please use the scope setup as in https://github.com/polarsource/examples/blob/main/with-astro-cloudflare-workers/scope.ts and https://github.com/polarsource/examples/blob/main/with-astro-cloudflare-workers/package.json#L8?
|
I've updated the bounty to be $150 for the efforts. |
just to align intention, does this effectively only replace the POLAR_MODE switch of prod and sandbox? is there need to retain SANDBOX_POLAR_WEBHOOK_SECRET, SANDBOX_POLAR_SUCCESS_URL? |
|
Should've clarified in my original message, the envs now should be only:
|
I have an implementation works on local but, when deploying to Vercel, I made use of run scope in the build command to embed the POLAR_MODE env var, it fails with error. This is for Build time Another implementation, I explored was obtaining the POLAR_MODE from getScope but this would be at runtime. Would love to get your thoughts? |
thanks, looking into it |
|
@rishi-raj-jain this is the error obtained when deploying on Vercel. My blocker is determining the proper way to set the POLAR_MODE env var using the scope script. It deploys successfully, but the POLAR_MODE env var is still missing and so does not work as expected. I have looked other approved PR's and surprisingly they bypassed this blocker by reverting to the core API instead of using the framework's polar sdk for checkout, customer-portal and webhooks. You might want to look into that.
|
|
Ah yeah, the missing .env is fine on Vercel. You can just use the POLAR_MODE as expected in your case. |
|
I'll review this tonight hopefully so you can stop updates on this PR before that. |
|
@rishi-raj-jain Could you get to this, it's been a minute. More strength to you, I infer you're really occupied at work |

fix #7
Overview
This PR adds a complete Astro integration example
with-astrothat demonstrates how to build a products-services application using Polar's SDK and Astro adapter for seamless webhooks handling, customer portal integration, and checkout session creation.Implementation Checklist
Following the guidelines from https://docs.polar.sh/integrate/sdk/adapters/astro:
with-astroProject Structure
Key Features
Environment Configuration
Checkout Integration
Customer Portal
Webhooks Handler
Validation Script
<! --Optional build-time script that validates: -->
Documentation
Installation Guide
Comprehensive
README.mdfollowing the recommended stylistic guide pattern fromEnvironment Configuration
.env.examplewith detailed comments linking to Polar documentationDeployment and Demo
Vercel Deployment
Live Deployment: https://polar-astro.vercel.app
Demo Recording
Video Recording
video-lite.mp4
Alternative link: http://bit.ly/4nP5lcj
Recording demonstrates:
Related Documentation
This example provides a solid foundation for building products-services applications with Polar and Astro, following all best practices and providing comprehensive documentation for developers to get started quickly.
Fixes #7