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: Usually yes.
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 clientDefault Quran Foundation client typeYes, on the backend onlyBackendfrontend uses public, backend uses server
Public clientExplicitly approved by Quran FoundationNoApp or browser with PKCEpublic only
Confidential-proxy appFrontend app backed by your own serverBackend onlyBackendfrontend uses public, backend uses server

Short Answer

  • Most clients are confidential by default.
  • Most apps should do PKCE in the frontend and token exchange on the backend.
  • 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.