Skip to content

Manifest File

The .rep.yaml manifest is optional but powerful. It enables:

  • Startup validation — fail fast if a required variable is missing
  • Type constraints — enforce url, number, enum, csv shapes
  • TypeScript typesrep typegen generates typed get() / getSecure() overloads
  • Documentation — a single source of truth for every variable the app uses
version: "0.1.0"
variables:
API_URL:
tier: public
type: url
required: true
description: "Base URL for the backend REST API"
example: "https://api.example.com"
FEATURE_FLAGS:
tier: public
type: csv
required: false
default: ""
description: "Comma-separated feature flags"
example: "dark-mode,new-checkout"
ENV_NAME:
tier: public
type: enum
required: true
values: ["development", "staging", "production"]
description: "Current deployment environment"
ANALYTICS_WRITE_KEY:
tier: sensitive
type: string
required: true
description: "Analytics service write key"
OAUTH_CLIENT_ID:
tier: sensitive
type: string
required: true
pattern: "^[a-zA-Z0-9]{20,}$"
description: "OAuth 2.0 client identifier"
UPSTREAM_AUTH_TOKEN:
tier: server
type: string
required: false
description: "Bearer token for upstream proxying"
settings:
strict_guardrails: true
hot_reload: true
session_key_ttl: "30s"
session_key_max_rate: 10
allowed_origins:
- "https://app.example.com"
FieldTypeRequiredDescription
tierpublic / sensitive / serverYesSecurity classification
typesee belowYesValue type constraint
requiredbooleanNoWhether the variable must be present at startup
defaultstringNoDefault value if not provided
descriptionstringNoHuman-readable description
examplestringNoExample value
patternstringNoRegex pattern the value must match
valuesstring[]NoAllowed values (for enum type)
deprecatedbooleanNoMark as deprecated
deprecated_messagestringNoMigration guidance for deprecated vars
TypeValidation
stringAny string value
urlMust be a valid URL
numberMust parse as a number
booleanMust be true, false, 1, or 0
csvComma-separated values
jsonMust be valid JSON
enumMust match one of the values array entries
SettingTypeDefaultDescription
strict_guardrailsbooleanfalseExit on guardrail warnings
hot_reloadbooleanfalseEnable hot reload SSE
hot_reload_modestringsignalfile_watch, signal, or poll
hot_reload_poll_intervalstring30sPoll interval (Go duration)
session_key_ttlstring30sSession key expiry
session_key_max_ratenumber10Max session key requests per minute per IP
allowed_originsstring[][]CORS allowed origins for session key endpoint
Terminal window
rep validate --manifest .rep.yaml

Output:

✓ Manifest is valid
Version: 0.1.0
Variables: 6 total
- PUBLIC: 3
- SENSITIVE: 2
- SERVER: 1
Settings configured: 4

Use in CI to catch configuration errors before deployment:

- name: Validate REP manifest
run: npx @rep-protocol/cli validate --manifest .rep.yaml

Generate TypeScript type definitions from your manifest:

Terminal window
rep typegen --manifest .rep.yaml --output src/rep.d.ts

This creates typed overloads for get() and getSecure():

declare module "@rep-protocol/sdk" {
export interface REP {
get(key: "API_URL" | "FEATURE_FLAGS" | "ENV_NAME"): string | undefined;
getSecure(key: "ANALYTICS_WRITE_KEY" | "OAUTH_CLIENT_ID"): Promise<string>;
}
}

For the full schema reference, see Manifest Schema Reference.