
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@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,
server: "sandbox", // Use sandbox if you're testing Polar - omit the parameter or pass 'production' otherwise
}),
);
Pass query params to this route.
?productId=xxx
?productPriceId=xxx
?productId=xxx&customerId=xxx
?productdId=xxx&customerExternalId=xxx
?productId=xxx&customerEmail=janedoe@gmail.com
?productId=xxx&customerName=Jane
URL-Encoded JSON string
Create 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
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
The npm package @polar-sh/elysia receives a total of 281 weekly downloads. As such, @polar-sh/elysia popularity was classified as not popular.
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 0 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.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.