Skip to main content

Settings & Secrets

Configure your API with settings for public configuration and secrets for sensitive credentials.

Custom Settings

Settings are simple key-value pairs accessible via the API. Use them for application configuration that doesn't need to be secret.

Creating Settings

  1. Go to SettingsCustom Settings
  2. Click Add Setting
  3. Enter a key and value
  4. Save

Accessing Settings

Retrieve settings via the _settings endpoint:

GET https://eu.restapi.com/my-api/_settings

Response:

{
"featureFlags": "dark-mode,beta-features",
"maxUploadSize": "10485760",
"supportEmail": "support@example.com"
}

Use Cases

Use CaseExample
Feature flagsenableNewUI: true
ConfigurationmaxItemsPerPage: 50
Public valuescompanyName: Acme Corp
Environment settingsenvironment: production
note

Settings are not encrypted. Don't store sensitive data like passwords or API keys here. Use Secrets instead.

Secrets

Secrets are encrypted credentials that can only be accessed by functions. They're never exposed via the API.

Creating Secrets

  1. Go to SettingsSecrets
  2. Click Add Secret
  3. Enter a key and value
  4. Save

Security Features

  • Encrypted at rest — Values stored securely
  • Hidden by default — Values shown as asterisks
  • Function-only access — Cannot be retrieved via API
  • One-way storage — You cannot retrieve the original value

Using Secrets in Functions

  1. When editing a function, select which secrets to inject
  2. Access them via the secrets object:
const apiKey = secrets.STRIPE_API_KEY;
const webhookSecret = secrets.WEBHOOK_SECRET;

await fetch('https://api.stripe.com/v1/charges', {
headers: {
'Authorization': `Bearer ${secrets.STRIPE_SECRET_KEY}`
}
});

Use Cases

Use CaseExample Key
API keysSTRIPE_API_KEY
Database credentialsDB_PASSWORD
OAuth secretsGOOGLE_CLIENT_SECRET
Webhook secretsWEBHOOK_SIGNING_SECRET
Encryption keysENCRYPTION_KEY
warning

Never log secrets or include them in error messages. They should remain hidden.

Service Connections

Service connections define how to authenticate with external services.

Creating a Connection

  1. Go to SettingsService Connections
  2. Click Add Connection
  3. Configure:
    • Name — Identifier for the connection
    • Auth Method — OAuth2Token, APIKey, or custom
    • Auth URL — Authentication endpoint
    • Request Fields — Parameters like client_id, client_secret

Use Cases

  • Standardize how functions connect to external APIs
  • Centralize authentication configuration
  • Simplify function code

Web App Settings

Configure your hosted web application.

General Settings

SettingDescription
Web App URLYour application hostname (.restapi.cloud or custom domain)
Login URLDirect link to hosted login page

Login Customization

Brand the login experience:

SettingDescription
Logo URLURL to your logo image
Background ColorHex color code for background
Login HeaderCustom text above login buttons
Redirect URIsAllowed redirect URLs after login

Security Headers

Configure HTTP security headers:

HeaderPurpose
CSPContent Security Policy — controls resource loading
HSTSHTTP Strict Transport Security — forces HTTPS
X-Frame-OptionsPrevents clickjacking
X-Content-Type-OptionsPrevents MIME sniffing
Referrer-PolicyControls referrer information
Permissions-PolicyControls browser features

Click Set to Default to apply recommended security values.

File Explorer

Upload static files for your web app:

  1. Go to App SettingsFiles
  2. Drag and drop files or click to select
  3. Files are immediately available at your web app URL

Supported files: HTML, CSS, JavaScript, images, PDFs, audio, video, and more.

Security Settings

Authentication Providers

Configure identity providers for user authentication:

  1. Go to SecurityAuth Providers
  2. Click + New authentication provider
  3. Select a provider and configure credentials
ProviderConfiguration
MicrosoftClient ID, optional single-tenant with Organization
GoogleClient ID
AppleClient ID
FacebookApp ID, Secret
OpenID ConnectClient ID, Secret, Issuer URL
PasskeyNo credentials required (WebAuthn)
VippsClient ID, Secret, Subscription Key, MSN
Vipps MT (Test)Test environment for Vipps

Options:

  • Single tenant (Microsoft only) — Restrict to a specific Azure AD organization
  • Login with popup — Use popup window instead of redirect

CORS

Control which domains can access your API:

  1. Go to SecurityCORS
  2. Add allowed origins
  3. Configure allowed methods and headers

IP Whitelist

Restrict API access to specific IP addresses:

  1. Go to SecurityIP Whitelist
  2. Add trusted IP addresses or ranges

reCAPTCHA

Protect against bots:

  1. Go to SecurityreCAPTCHA
  2. Enable and configure your site key
  3. Choose v2 or v3
  4. Set score threshold (v3)

Enable cookie-based authentication:

  1. Go to SecurityCookies
  2. Enable cookie authentication
  3. Configure CSRF protection

Best Practices

  • Use Secrets for credentials — Never store sensitive data in Settings
  • Descriptive key names — Use clear names like STRIPE_API_KEY
  • Document settings — Keep track of what each setting does
  • Rotate secrets regularly — Update credentials periodically
  • Limit secret access — Only inject secrets into functions that need them
  • Test security headers — Verify headers don't break your application