FEATUREFLOW V2AI-native · MCP-enabled ·30% off your first year:NEXT30claim →

mobile SDK

iOS feature flags

The iOS SDK is a client SDK for iOS, macOS, tvOS and watchOS. It asks Featureflow for values already evaluated for one user. It does not download your rules. Ship a client key (sdk-js-env-…), never a server key. Requires iOS 13+, Swift 5.9+, and the license in the docs is MIT.

iOS docsGitHubfeatureflow-ios-sdk

Set it up with your coding agent

Paste this into Claude Code, Cursor or any coding agent. It installs the iOS SDK, creates the client and evaluates your first flag.

Set up Featureflow with the iOS SDK in this project. Run `npx skills add featureflow/featureflow-skills --skill featureflow-setup -y` first, then follow the skill. Keep SDK keys in env vars.

Or set it up by hand

Install

Swift Package Manager
.package(url: "https://github.com/featureflow/featureflow-ios-sdk.git", from: "0.2.0")

Initialise

initialize
import Featureflow

let user = FeatureflowUser.Builder("user-123")
    .withAttribute("tier", "gold")
    .withAttributes("roles", ["beta"])
    .build()

let featureflow = await FeatureflowClient.initialize(
    apiKey: "sdk-js-env-YOUR_KEY",
    user: user
)

Evaluate a flag

evaluate
if featureflow.evaluate("new-checkout").isOn() {
    // the new checkout
} else {
    // the old one
}

Kill switch

Branch on evaluate("new-checkout").isOn(). Set FeatureflowConfig.defaultVariants for the variant to serve before the first fetch and when offline. Anything unlisted is off. For a kill switch whose safe path is on, set that default explicitly. initialize never throws. If Featureflow is unreachable it uses the on-disk cache, then your defaults.

The operational side is the kill switch. Turning the flag off does not require a redeploy.

Gradual rollout

Percentage rollouts bucket on the user id. The docs say an id that changes per launch turns a user rollout into a session rollout. Omit the user and the SDK generates an anonymous id and persists it. Do not delete a flag a shipped build still reads. Archive it instead.

See progressive rollout for the dashboard control. Release pipelines and approval workflows, if the change itself needs a review, are on the Business plan at $399 a month. That price is on the pricing page.

Targeting

FeatureflowUser.Builder(id).withAttribute and withAttributes attach strings, numbers, booleans, dates or arrays. withSessionAttribute is used for the evaluation and is not persisted. await featureflow.updateUser(loggedInUser) on login and logout. JSON config is jsonValue(as:) and returns nil when the variant has none, so keep a fallback. track("purchase", value: 49.95) records a goal.

Frequently asked questions

How do I add iOS feature flags?

In Xcode, File → Add Package Dependencies, and enter https://github.com/featureflow/featureflow-ios-sdk.git. Or add .package(url:from: "0.2.0") in Package.swift. Swift Package Manager is the only supported install method.

Which key goes in the app?

A client key starting with sdk-js-env-. The docs say a server key downloads the ruleset and must never be built into an .ipa. Rotate it if it has been.

Does evaluate take a user?

No. evaluate(key) reads the user you passed to initialize. Change the user with updateUser. peek(key) reads a value without recording an impression.

Other SDKs

Create the flag, then evaluate it

Every SDK is on the free plan. No credit card.