Skip to content

Official JavaScript/TypeScript based Backend SDK for Freemius API, plus a Shadcn-based SaaS starter kit for rapid app development and integration.

License

Notifications You must be signed in to change notification settings

Freemius/freemius-js

Repository files navigation

Freemius JavaScript

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.

npm version License: MIT TypeScript

Fallback image description

Freemius Paywall Component


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.

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.

Support / Questions

Please open an issue for reproducible defects or clearly scoped feature gaps that align with the minimal, execution‑oriented philosophy of this repository.

Features & Packages

@freemius/sdk (Server / Edge Runtimes)

Focused, framework‑agnostic primitives for securely interacting with the Freemius platform:

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.

Security 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.

Contributing

  1. Fork & clone
  2. npm install
  3. Create a feature branch (e.g. feat/<concise-scope>)
  4. Implement change; run local builds / lint; add or update a changeset (npx changeset) if publishing a package change
  5. Commit with a precise, imperative message
  6. Open a PR referencing any related issue(s)

Read Contribution Principles for more details.

License

MIT © Freemius Inc


Payments, tax handling, subscription lifecycle management, and licensing are abstracted so you can focus on product functionality rather than billing infrastructure.

https://freemius.com

About

Official JavaScript/TypeScript based Backend SDK for Freemius API, plus a Shadcn-based SaaS starter kit for rapid app development and integration.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages