
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@polar-sh/fastify
Advanced tools
Payments and Checkouts made dead simple with Fastify.
pnpm install @polar-sh/fastify zod
Create a Checkout handler which takes care of redirections.
import fastify from "fastify";
import { Checkout } from "@polar-sh/fastify";
fastify().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
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
URL-Encoded JSON string
Create a customer portal where your customer can view orders and subscriptions.
import fastify from "fastify";
import { CustomerPortal } from "@polar-sh/fastify";
fastify().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 fastify from 'fastify'
import { Webhooks } from "@polar-sh/fastify";
fastify.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 Fastify
The npm package @polar-sh/fastify receives a total of 24 weekly downloads. As such, @polar-sh/fastify popularity was classified as not popular.
We found that @polar-sh/fastify 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.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.