Examples

TanStack Start (confidential)

Authorization Code with a client_secret kept server-side — for apps that have a backend.

TanStack Start confidential OAuth client

The Authorization Code flow with a client_secret kept server-side — for apps that have a backend (TanStack Start, Next, Remix, Express…). Tokens are stored in httpOnly cookies, so the browser never sees the secret or the raw access token.

Deploy it

Or scaffold it locally:npm create @model-match -- --template tanstack-confidential

What you'll need

A confidential OAuth client with a client secret, and its redirect URI set to your deployed callback. Keep the secret server-side — never prefix it with VITE_. See Authentication.

Environment variables

VariableRequiredNotes
MODEL_MATCH_CLIENT_IDyesYour confidential OAuth client ID.
MODEL_MATCH_CLIENT_SECRETyesServer-side only. Never exposed to the browser.
MODEL_MATCH_REDIRECT_URIyesMust match a redirect URI on your OAuth client.
MODEL_MATCH_ISSUERnoDefaults to https://auth.modelmatch.com/api/auth.
MMR_API_URLnoDefaults to https://api.modelmatch.com.

Run it locally

npm create @model-match -- --template tanstack-confidential
cd tanstack-confidential
npm install
npm run dev

Open localhost:3000 and sign in.

On this page