Skip to main content

Prerequisites

  • Grantiva SDK installed (Installation)
  • Device attestation working (Quick Start) — flag endpoints authenticate with the attestation JWT, so call validateAttestation() before reading flags (in the Simulator, use API key mode instead)
  • At least one flag created in the dashboard

1. Create a flag in the dashboard

Go to Feature Flags in the dashboard sidebar and create a flag:
  • Key: dark_mode
  • Type: Boolean
  • Value: true (production), false (staging)

2. Read flags in your app

3. All flag types

4. Environments

A flag can hold a different value per environment. The SDK evaluates against production; set the other environments’ values in the dashboard for your staging and development builds.

5. Cache control

Flags are cached in memory for 5 minutes:
Flag changes made in the dashboard also arrive over a live stream within seconds — see Live updates.

SwiftUI example

Tier limits

Next steps