Skip to main content

Auth Matrix

Purpose: Explain client types in plain English.
Use this when: You need to decide whether code exchange happens in the app or on the backend.
Do not use this when: You only need Content or Search examples.
Backend required: Depends on the selected Developer Console app type and API family.
Allowed runtimes: Node.js, serverless functions, workers, browser apps, mobile apps.
Required credentials: client_id always. client_secret only for confidential clients.
Minimal import: @quranjs/api/server and @quranjs/api/public.

Client typeWhat it meansCan hold client_secret?Where code exchange happensTypical SDK use
Confidential clientBackend/server app selected in Developer ConsoleYes, on the backend onlyBackendfrontend uses public, backend uses server
Public clientFrontend or mobile app selected in Developer ConsoleNoApp or browser with PKCEpublic only
Confidential-proxy appSDK frontend paired with a confidential backend/server appBackend onlyBackendfrontend uses public, backend uses server

Short Answer​

  • The app type selected in Developer Console determines whether the OAuth2 client is public or confidential.
  • Frontend or mobile apps are public: exchange in the app with PKCE and no secret.
  • Backend/server apps are confidential: start PKCE in the frontend when applicable, then exchange and refresh on the backend.
  • Apps that need Content or Search require a backend/server integration even if they also have a browser or mobile frontend.
  • Never put client_secret in frontend or mobile code.
  • If you are choosing between SPA only, mobile only, or frontend plus backend, read App Shapes.