Skip to content
FlagSwiftDocs

Quickstart

Create a flag, get a key, and read the flag from your app.

  1. Create a project and a flag

    No account yet? Choose Sign up in the console, then open the link in the verification email we send you. You are signed in once it is verified.

    In Projects, create a project, then open Flags and create one. A flag name is its key, for example new-dashboard. Turn it on in an environment such as Development.

  2. Create an API key

    Open API Keys and create a key for that project. Use a Client key (fs_client_…) for a browser or mobile app and a Server key (fs_srv_…) for a backend. The full key is shown when you create it, so copy it straight into your secrets.

    Never ship a server key to a browser

    Server and admin keys can read targeting and rollout data. Only client keys belong in a web or mobile app.
  3. Check it with one request

    bash
    curl -s "https://flags.example.com/api/v1/evaluation/client?user_identifier=user-123&env=development" \
      -H "Authorization: Bearer $FLAGSWIFT_CLIENT_KEY"

    The response lists each flag with enabled and, for multivariate flags, variant and value. The env parameter is only needed when the key covers every environment of the project. For a ready-made setup for your platform, see Integrations.

  4. Use an SDK

    tsx
    import { FlagClient, FlagProvider, useFlag } from "@flagswift/react";
    
    const client = new FlagClient({
      apiKey: process.env.NEXT_PUBLIC_FLAGSWIFT_KEY!, // fs_client_...
      baseUrl: "https://flags.example.com",
      environment: "development",
    });
    
    export const App = () => (
      <FlagProvider client={client} user={{ identifier: "user-123" }}>
        <Dashboard />
      </FlagProvider>
    );
    
    const Dashboard = () => (useFlag("new-dashboard") ? <NewDashboard /> : <OldDashboard />);

    More platforms, and the options each one takes, are in SDKs.