SyncingBoarddocs

Environment Variables

October 20, 2018~761 wordsenvironment-variables.md

Environment Variables Reference

This document provides a comprehensive reference of all environment variables supported by SyncingBoard. Environment variables are configured in .env.local for local development or set in your hosting platform (Vercel, AWS ECS, Netlify, Railway, Docker).


Core System & Domain Configuration

VariableTypeRequiredDefaultDescription
NEXT_PUBLIC_APP_URLStringYesNoneThe full public HTTPS URL of your deployment (e.g. https://syncingboard.com). Do not include a trailing slash. Used for OAuth redirects and CORS policy matching.

Target Adapter: Miro Credentials

VariableTypeRequiredDefaultDescription
MIRO_CLIENT_IDStringYesNoneClient ID generated in your Miro Developer App Portal.
MIRO_CLIENT_SECRETStringYesNoneClient Secret generated in your Miro Developer App Portal. Keep server-side only.

Source Adapter: Figma Credentials

VariableTypeRequiredDefaultDescription
FIGMA_CLIENT_IDStringFigma OnlyNoneClient ID generated in the Figma Developer Apps Portal (https://www.figma.com/developers/apps).
FIGMA_CLIENT_SECRETStringFigma OnlyNoneClient Secret generated in the Figma Developer Apps Portal. Keep server-side only.

Cloud Infrastructure Services

VariableTypeRequiredDefaultDescription
UPSTASH_REDIS_REST_URLStringPenpot / Rate-LimitingNoneUpstash Redis REST database URL (e.g., https://xxx.upstash.io). Required for Penpot image buffer relay and persistent serverless rate limiting.
UPSTASH_REDIS_REST_TOKENStringPenpot / Rate-LimitingNoneUpstash Redis REST bearer authentication token. Keep server-side only.
ABLY_API_KEYStringFigma Relay & PenpotNoneAbly Realtime API key (format: appId.keyId:keySecret). Required for Penpot WebSocket render signaling and Figma Companion selection auto-detect relay.

Rate Limiting & Protection Controls

SyncingBoard includes an optional 3-layer protection engine. Redis-backed rate limits are active when both UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN are configured; persistent Node hosts fall back to in-memory limits when Redis is absent.

VariableTypeDefaultDescription
RATE_LIMIT_ENABLEDBooleantrueSet to false to disable rate limiting entirely.
RATE_LIMIT_COMMUNITY_FIGMA_PER_MINNumber5Figma node-info and render requests allowed per minute per user OAuth token hash.
RATE_LIMIT_COMMUNITY_FIGMA_PER_DAYNumber50Figma render requests allowed per day per user OAuth token hash.
RATE_LIMIT_COMMUNITY_RELAY_PER_MINNumber5Penpot relay render requests allowed per minute per pairing ID.
RATE_LIMIT_COMMUNITY_RELAY_PER_HOURNumber30Penpot relay render requests allowed per hour per pairing ID.
RATE_LIMIT_COMMUNITY_RELAY_PER_DAYNumber100Penpot relay render requests allowed per day per pairing ID.
RATE_LIMIT_COMMUNITY_RELAY_SESSION_PER_MINNumber4Miro relay-session heartbeat/release requests allowed per minute per session ID.
RATE_LIMIT_COMMUNITY_MAX_RELAY_SESSIONSNumber40Maximum concurrent relay sessions across the Community deployment (target/source agnostic: Figma/Penpot → Miro today, FigJam/Mural later). 0 = unlimited (no cap; bounded only by your Ably connection limit). Legacy alias: RATE_LIMIT_COMMUNITY_MAX_MIRO_RELAY_SESSIONS.
RATE_LIMIT_COMMUNITY_MAX_COMPANION_TOKENSNumber180Maximum concurrent companion Ably tokens across the Community deployment (Figma/Penpot companions). Miro detectors keep a permanent 20-socket floor on top of this. 0 = unlimited (no cap; bounded only by your Ably connection limit).
RATE_LIMIT_COMMUNITY_UPDATE_IMAGE_PER_MINNumber10Miro image updates allowed per minute per user token.
RATE_LIMIT_COMMUNITY_ABLY_TOKEN_PER_MINNumber5Ably token authentication requests allowed per minute per client IP.
RATE_LIMIT_COMMUNITY_OAUTH_REFRESH_PER_MINNumber3OAuth refresh exchanges allowed per minute per refresh-token hash.
RATE_LIMIT_COMMUNITY_GLOBAL_SYNCS_PER_DAYNumber500Global daily cap on Figma render and Miro image-update resource operations across all users.
RATE_LIMIT_COMMUNITY_OAUTH_CALLBACK_PER_MINNumber20OAuth provider redirect callbacks allowed per minute per client IP.
RATE_LIMIT_COMMUNITY_RELAY_EXPORT_PER_MINNumber2Relay export commands allowed per minute per pairing ID.
RATE_LIMIT_COMMUNITY_RELAY_EXPORT_PER_DAYNumber20Relay export commands allowed per day per pairing ID.

Sample .env.example Template

Below is a complete template for your .env.local file during development or deployment setup:

# ==========================================
# Core System & Domain Configuration
# ==========================================
NEXT_PUBLIC_APP_URL=http://localhost:3000

# ==========================================
# Target Adapter: Miro OAuth Credentials
# ==========================================
MIRO_CLIENT_ID=your_miro_client_id
MIRO_CLIENT_SECRET=your_miro_client_secret

# ==========================================
# Source Adapter: Figma OAuth Credentials
# ==========================================
FIGMA_CLIENT_ID=your_figma_client_id
FIGMA_CLIENT_SECRET=your_figma_client_secret

# ==========================================
# Cloud Relay & Storage Services
# ==========================================
UPSTASH_REDIS_REST_URL=https://your-upstash-endpoint.upstash.io
UPSTASH_REDIS_REST_TOKEN=your_upstash_rest_token
ABLY_API_KEY=your_ably_api_key

# ==========================================
# Optional Rate Limiting Overrides
# ==========================================
RATE_LIMIT_ENABLED=true
RATE_LIMIT_COMMUNITY_FIGMA_PER_MIN=5
RATE_LIMIT_COMMUNITY_FIGMA_PER_DAY=50
RATE_LIMIT_COMMUNITY_GLOBAL_SYNCS_PER_DAY=500
On this page