
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@polar-sh/elysia
Advanced tools
Payments and Checkouts made dead simple with Elysia.
pnpm install @polar-sh/elysia zod
Create a Checkout handler which takes care of redirections.
import { Elysia } from "elysia";
import { Checkout } from "@polar-sh/elysia";
const app = new Elysia();
app.get(
"/checkout",
Checkout({
accessToken: "xxx", // Or set an environment variable to POLAR_ACCESS_TOKEN
successUrl: process.env.SUCCESS_URL,
returnUrl: "https://myapp.com", // Optional Return URL, which renders a Back-button in the Checkout
server: "sandbox", // Use sandbox if you're testing Polar - omit the parameter or pass 'production' otherwise
theme: "dark" // Enforces the theme - System-preferred theme will be set if left omitted
}),
);
Pass query params to this route.
?products=123?products=123&customerId=xxx?products=123&customerExternalId=xxx?products=123&customerEmail=janedoe@gmail.com?products=123&customerName=Jane?products=123&seats=5 - Number of seats for seat-based productsURL-Encoded JSON stringCreate a customer portal where your customer can view orders and subscriptions.
import { Elysia } from "elysia";
import { CustomerPortal } from "@polar-sh/elysia";
const app = new Elysia();
app.get(
"/portal",
CustomerPortal({
accessToken: "xxx", // Or set an environment variable to POLAR_ACCESS_TOKEN
getCustomerId: (event) => "", // Fuction to resolve a Polar Customer ID
returnUrl: "https://myapp.com", // Optional Return URL, which renders a Back-button in the Customer Portal
server: "sandbox", // Use sandbox if you're testing Polar - omit the parameter or pass 'production' otherwise
}),
);
A simple utility which resolves incoming webhook payloads by signing the webhook secret properly.
import { Elysia } from 'elysia'
import { Webhooks } from "@polar-sh/elysia";
const app = new Elysia()
app.post('/polar/webhooks', Webhooks({
webhookSecret: process.env.POLAR_WEBHOOK_SECRET!,
onPayload: async (payload) => /** Handle payload */,
}))
The Webhook handler also supports granular handlers for easy integration.
FAQs
Polar integration for Elysia
We found that @polar-sh/elysia demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.

Product
Bringing supply chain security to the next generation of JavaScript package managers