Get environment configuration
GET
/_torii/environment
const url = 'https://your-app.torii.so/_torii/environment';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://your-app.torii.so/_torii/environmentSingle discovery call. Returns the SDK’s env-public bundle.
Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ” Host
string
Responses
Section titled “ Responses ”OK
Media type application/json
Aggregated environment-public config the SDK uses on cold load.
object
environment
required
Environment type literal (e.g. SANDBOX, PRODUCTION).
string
turnstileSiteKey
Cloudflare Turnstile site key. Null when CAPTCHA is disabled.
string | null
legal
required
Legal-consent settings driving the signup form’s checkbox.
object
requireConsent
required
When true, the SDK signup form shows a checkbox the user must tick.
boolean
termsOfServiceUrl
Public URL to the Terms of Service, or null.
string | null
privacyPolicyUrl
Public URL to the Privacy Policy, or null.
string | null
oauthProviders
required
OAuth providers enabled for this environment.
Array<object>
Single enabled OAuth provider as it appears in the boot bundle.
object
name
required
string
displayName
required
string
issuer
required
string
signupEnabled
required
Whether end-user signup is allowed on this deployment.
boolean
brandingRequired
required
Whether the “Powered by Torii.so” footer is required (tier gate).
boolean
Example generated
{ "environment": "example", "turnstileSiteKey": "example", "legal": { "requireConsent": true, "termsOfServiceUrl": "example", "privacyPolicyUrl": "example" }, "oauthProviders": [ { "name": "example", "displayName": "example", "issuer": "example" } ], "signupEnabled": true, "brandingRequired": true}