Integration quickstart

Add the AddonPass check to your addon.

Install the SDK, put its check in front of your Stremio routes, and make sure the paid addon can’t be reached without it.

Open developer setup
01 · Request flow

Only the hash leaves your server.

Stremio requestHash the tokenCheck accessAddon handler

The install token is a random 43-character string. The SDK hashes it and sends only the hash to AddonPass; the token never leaves your server.

02 · Configure

Keep the API credential on your server.

Install the SDK from its pinned GitHub tag. Keep the API credential in your server secrets and out of source control.

Install SDK
pnpm add @addon-pass/sdk
Environment variables
ADDONPASS_API_URL=https://api.addonpass.com
ADDONPASS_INTEGRATION_CREDENTIAL=ADDON_SCOPED_CREDENTIAL
# Leave empty until you create a plan, then list its ID and redeploy.
ADDONPASS_ALLOWED_PLAN_IDS=
ADDONPASS_MANAGEMENT_URL=https://addonpass.com/subscriptions
03 · Add the SDK

Choose the adapter that matches your server.

Adapters are included for Node HTTP, Fetch-style runtimes, Express 5, and Fastify 5. The core check works with any framework.

Node HTTP
import {
  AddonPassVerifier,
  createNodeStremioHandler,
} from "@addon-pass/sdk";

const verifier = new AddonPassVerifier({
  apiBaseUrl: process.env.ADDONPASS_API_URL,
  integrationCredential: process.env.ADDONPASS_INTEGRATION_CREDENTIAL,
  allowedPlanIds: process.env.ADDONPASS_ALLOWED_PLAN_IDS
    .split(",")
    .map((id) => id.trim()),
});

const handle = createNodeStremioHandler({
  access: {
    addonId: "com.example.private-addon",
    addonName: "Private Addon",
    managementUrl: process.env.ADDONPASS_MANAGEMENT_URL,
  },
  verifier,
  upstream: handleYourStremioRequest,
});
04 · Access checks

How access is checked.

The API credential identifies one addon. The list of allowed plans is a second check that blocks anything unexpected. Successful checks are cached for at most five seconds and never past the paid-through date or grace period.

Creating a new credential shows it once. Store it in your server secrets, deploy it, confirm traffic is flowing, then revoke the old credential.

05 · Access states

What subscribers get in each state.

Active
Serve normal addon JSON.
Grace period
Serve normal addon JSON until the grace period ends.
Expired or cancelled
Return valid Stremio JSON that points to renewal; never run the addon handler.
Invalid token
Return a plain 404 without revealing whether a subscription exists.
AddonPass unavailable
Either allow a short grace period when AddonPass is unreachable (opt-in) or return 503.
06 · Test mode

Try it with test money first.

The developer dashboard has a Live and Test switch at the top. Test mode runs on Base Sepolia, a practice network where USDC and ETH are free and have no value. You register, create plans, and pay through checkout exactly as you would live, and no real money moves.

Test and live are kept apart. Each has its own sign-in, developer registration, addons, plans, and API credentials, and nothing carries over between them. Checkout links open on the network of their plan.

Switch to Test
Open the developer dashboard and choose Test in the bar at the top. Your wallet is asked to switch to Base Sepolia when it needs to.
Get test USDC
Subscriptions and the 1 USDC integration test are paid in test USDC. It is free from the Circle faucet: choose USDC and Base Sepolia, then paste your wallet address.
Get test ETH
Your wallet pays a small network fee when you register, create a plan, or run the integration test. On the test network that fee is paid in test ETH, free from the Coinbase Developer Platform faucet: sign in, choose Base Sepolia and ETH, then paste your wallet address.
Use a test credential
Create the API credential while in test mode. It starts with ap_test_ and only unlocks test subscriptions; live credentials start with ap_live_. The API URL stays the same.
Go live
When everything works, switch to Live and set up again with real USDC and a live credential. On Base, Ambire lets you pay network fees in USDC; other wallets may need a little ETH.
07 · Test

Test it before you publish.

Confirm the unprotected manifest is blocked, an invalid token never reaches a handler, CORS headers are present, an expired subscription gets Stremio JSON, and an AddonPass outage never opens access.

08 · Unprotected routes

Close every unprotected route.

Do not expose /manifest.json, resource handlers, an old port, or another hostname that skips the AddonPass check. A wrapper in front of a public addon is not access control.

Who handles support
09 · Donations

Take donations with a one-time plan.

AddonPass has no separate donate button. A one-time plan does the job: a supporter pays a fixed amount once, nothing renews, and they get an install link that doesn't expire.

Add a supporter edition
Plans always sell access to a protected addon. Both editions can share one domain: your free addon stays at /manifest.json, and the supporter edition runs behind the AddonPass check under /addonpass. Register it with https://your-domain/addonpass as its addon server URL.
Give it its own look
In the supporter edition's manifest, set a different id, name, logo, and background. Stremio shows them, so supporters can tell the two apart, and the logo also appears on the checkout page.
Create a one-time plan
In the dashboard, create a plan, choose One time as the billing period, and set an amount from 0.50 to 10,000 USDC. The amount is fixed, so create one plan for each amount you want to offer and add every plan ID to ADDONPASS_ALLOWED_PLAN_IDS.
Share the checkout link
Each plan has its own checkout link. Post it wherever you would put a donate button: your README, your addon description, or your community.
Get paid
Each payment lands in your AddonPass balance, minus the AddonPass fee (5% + 0.10 USDC on the Free tier), ready to withdraw. Payments are final, and AddonPass can't issue refunds.
10 · Coding agents

Hand the integration to your AI agent.

Paste this prompt into Claude Code, Codex, Cursor, or another coding agent working in your addon repository. It covers the SDK setup, the routes to protect, and the checks to run before you deploy. The addon dashboard has a copy with your URLs filled in.

AI agent prompt
# Add AddonPass paid access to this addon

You are integrating the `@addon-pass/sdk` npm package into this Stremio addon server so only paying subscribers can use it. Follow these instructions exactly. Do not invent SDK APIs; if something here disagrees with the installed package, the package wins.

## Before writing code
1. Detect the server framework from package.json: Node `http`, a Fetch-style runtime (Request in, Response out: Next.js route handlers, Hono, Workers), Express 5, or Fastify 5. The SDK is ESM-only and needs Node 22.14 or newer.
2. Install it: `pnpm add @addon-pass/sdk` (use the project's package manager).
3. Read `node_modules/@addon-pass/sdk/AGENTS.md` if it exists, then the package README and its `.d.ts` types. They describe the installed version.

## Configuration (server-side only)
- `ADDONPASS_API_URL=https://api.addonpass.com`
- `ADDONPASS_INTEGRATION_CREDENTIAL`: this addon's credential from the AddonPass dashboard (`ap_live_…` for Base, `ap_test_…` for Base Sepolia). Use a placeholder; the developer sets the real value. Never commit it, log it, or send it to a browser.
- `ADDONPASS_ALLOWED_PLAN_IDS`: comma-separated plan IDs from the addon page. Empty is fine until a paid plan exists.
- `ADDONPASS_MANAGEMENT_URL=https://addonpass.com/subscriptions`

## Wire it up
- Create one `new AddonPassVerifier({ apiBaseUrl, integrationCredential, allowedPlanIds })` per process. Split the plan IDs on commas, trim them, and drop empty entries.
- `access` is `{ addonId, addonName, managementUrl }`; reuse the manifest's `id` and `name`.
- Choose one adapter:
  - Node `http`: `createNodeStremioHandler({ access, verifier, upstream })` from `@addon-pass/sdk`.
  - Fetch runtimes: `createFetchStremioHandler({ access, verifier, upstream })` from `@addon-pass/sdk`.
  - Express 5: `app.use(createExpressStremioMiddleware({ access, verifier }))` from `@addon-pass/sdk/express`, before every Stremio route. Read the decision with `expressAddonPassAuthorization(res)`.
  - Fastify 5: `createFastifyStremioProtection({ access, verifier })` from `@addon-pass/sdk/fastify`. Register every protected route under `/addonpass/:token/…` with `preHandler: protection.preHandler`.
- Subscribers install `https://YOUR_HOST/addonpass/{token}/manifest.json`. The SDK checks the token, removes the `/addonpass/{token}` prefix, and the existing handlers see the usual `/manifest.json`, `/catalog/…`, `/meta/…`, `/stream/…`, `/player/…` and `/library/…` paths.

## Rules
- Protect manifest.json, catalog, meta and stream, plus the player and library events if the manifest declares them (SDK 0.1.10 or newer). Nothing paid may be reachable without a token: remove or protect any public Stremio `/manifest.json` and any copy of these routes on another path, port or host.
- No redirects on these paths (http to https, trailing slash, www). Serve them over HTTPS on port 443, as `application/json`, without compression on the manifest.
- Don't add your own entitlement cache, and don't log URLs that contain the token.
- Only change what this integration needs.

## AddonPass dashboard values
- Addon server URL: `https://YOUR_HOST/addonpass/`. Use the protected base path, not the site root; a website `/manifest.json` at the root fails the live check.
- Install URL template: `https://YOUR_HOST/addonpass/{token}/manifest.json`

## Verify before finishing
- Run the server and request `/addonpass/manifest.json` and `/addonpass/<random 43-character base64url>/manifest.json`. Both must return 404 (401 or 403 also pass).
- Tell the developer to set the real credential, deploy over public HTTPS, and run the live integration test in the AddonPass dashboard.
- Add this line to the repo's AGENTS.md (create it if missing, and a CLAUDE.md containing `@AGENTS.md` if the project uses Claude Code): "AddonPass protects this addon. Read node_modules/@addon-pass/sdk/AGENTS.md before changing routes, access checks or AddonPass settings."
- Summarize what you changed and which environment variables must be set.

Agents can also read it at /agent-prompt.md and find it from /llms.txt.