Type-safe Freemius integration toolkit: a production-focused TypeScript/JavaScript SDK plus a React / Next.js Starter Kit for implementing subscriptions, one‑off purchases, license & entitlement validation, and a secure self-service customer portal.
Looking for a step‑by‑step walkthrough of backend checkout generation, secure purchase validation, local entitlement storage, webhook‑driven license lifecycle syncing, and feature gating logic? Check out the guides below.
- Next.js / React Starter Kit Integration.
- Framework Agnostic Integration.
We also have the React Starter Kit you can use on your front-end to quickly render Checkout overlays, pricing tables, and a customer portal.
- Core SDK Docs: https://freemius.com/help/documentation/saas-sdk/js-sdk/
- Next.js Integration: https://freemius.com/help/documentation/saas-sdk/framework/nextjs/
- General Integration Flow: https://freemius.com/help/documentation/saas-sdk/js-sdk/integration/
- React Starter Kit: https://freemius.com/help/documentation/saas-sdk/react-starter/
- Issues / Bug Reports: https://github.com/Freemius/freemius-js/issues
Please open an issue for reproducible defects or clearly scoped feature gaps that align with the minimal, execution‑oriented philosophy of this repository.
@freemius/sdk
(Server / Edge Runtimes)
Focused, framework‑agnostic primitives for securely interacting with the Freemius platform:
- Typed API Client: Fine-tuned OpenAPI-derived API classes to easily interact with the Freemius REST API.
- Checkout Utilities: Create Checkout URLs or Options for the Overlay mode, sandbox mode, redirect result parsing etc.
- Webhook Processing: HMAC‑SHA256 signature verification + event listener abstraction
- Purchases & Entitlements: License retrieval, entitlement state validation, minimal model helpers
See the full documentation for all exported capabilities.
React Starter Kit (Next.js / React)
An opinionated, production‑ready reference implementation showing how to operationalize the SDK inside a modern React / Next.js stack. Built with shadcn/ui + Tailwind CSS.
Included building blocks:
- Checkout:
CheckoutProvider
+ context wiring for invoking overlay checkout from any component - Pricing / Paywall:
Subscribe
&Topup
components for plan display, subscription initiation, and credit top‑ups - Customer Portal: Authenticated portal UI for subscription, billing method, and invoice management
See the Starter Kit docs for component APIs and integration notes.
Hard requirements for a correct integration:
- Secrets: Never expose
API_KEY
,SECRET_KEY
, or signing material to the browser or untrusted execution contexts. - Webhooks: Always verify the HMAC‑SHA256 signature using the raw, unparsed request body before mutating state.
- Fork & clone
npm install
- Create a feature branch (e.g.
feat/<concise-scope>
) - Implement change; run local builds / lint; add or update a changeset (
npx changeset
) if publishing a package change - Commit with a precise, imperative message
- Open a PR referencing any related issue(s)
Read Contribution Principles for more details.
MIT © Freemius Inc
Payments, tax handling, subscription lifecycle management, and licensing are abstracted so you can focus on product functionality rather than billing infrastructure.