Get environment configuration
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 ”Responses
Section titled “ Responses ”OK
Aggregated environment-public config the SDK uses on cold load.
object
Environment type literal (e.g. SANDBOX, PRODUCTION).
Cloudflare Turnstile site key. Null when CAPTCHA is disabled.
Legal-consent settings driving the signup form’s checkbox.
object
When true, the SDK signup form shows a checkbox the user must tick.
Public URL to the Terms of Service, or null.
Public URL to the Privacy Policy, or null.
OAuth providers enabled for this environment.
Single enabled OAuth provider as it appears in the boot bundle.
object
Whether end-user signup is allowed on this deployment.
Whether the “Powered by Torii.so” footer is required (tier gate).
Per-environment auth-method toggles driving which forms the SDK renders.
object
When true, the SDK renders the email + password sign-up form.
When true, the SDK renders the email + password sign-in form.
When true, sign-up sends a verification code before completing.
Whether multiple concurrent user sessions per client are enabled.
Example generated
{ "environment": "example", "turnstileSiteKey": "example", "legal": { "requireConsent": true, "termsOfServiceUrl": "example", "privacyPolicyUrl": "example" }, "oauthProviders": [ { "name": "example", "displayName": "example", "issuer": "example" } ], "signupEnabled": true, "brandingRequired": true, "auth": { "emailSignUpEnabled": true, "emailPasswordSignInEnabled": true, "verifyEmailAtSignUp": true }, "multiSessionEnabled": true}