In this guide, we’ll show you how to integrate Polar with Next.js.
POLAR_ACCESS_TOKEN
environment variable.
You can create an organization access token from your organization settings.
Polar
class. This class uses the provided access token to authenticate with the Polar API.
sandbox
with production
when you’re ready to switch to the production environment.
your-app.com/api/webhook/polar
. This must be an absolute URL which Polar can reach. If you use ngrok, the URL will look something like this: https://<your-ngrok-id>.ngrok-free.app/api/webhook/polar
.checkout.updated
event and update the UI accordingly when it reaches the succeeded status.