Getting Started

Quickstart

Welcome to ConfigDirector docs! This is a quickstart guide to get you up and running.

Welcome to ConfigDirector, a cloud service to manage remote configuration and feature flags.

In this section we'll walk you through:

  1. Creating your first config
  2. Installing and configuring an SDK
  3. Retrieving the config in your app via the SDK
  4. Configuring user contexts and targeting rules

1. Create your first config

  1. Sign In to the ConfigDirector dashboard. You'll be prompted to create a free account if you don't have one. Don't worry, it's free to start and does not require a payment method. You can later choose to upgrade your account.
  2. Click on the Create button next to the Configs navigation to create a new config:

  1. Enter a key (the key is both the name and how you'll reference it in code) for the config, adjust other selections, and save it.

2. Install and configure an SDK for your language and framework

Client and server SDK keys belong to an environment within your project. Use environment variables to provide them at runtime to match the given environment.
  1. Retrieve your client and server SDK keys for each environment by going to project settings in the navigation panel:

  1. Under the Environments & SDK Keys tab, select each environment to access its client and server SDK keys.
  2. Install and configure an SDK for your application stack:
Server SDK keys are secret values. Do not commit them to your source code repository. Provide them at runtime via environment variables instead.
npm install --save @configdirector/client-sdk
config-director-setup.ts (Initialize the client)
import { createClient } from "@configdirector/client-sdk";

export const client = createClient("YOUR-CLIENT-SDK-KEY");
await client.initialize();
npm install --save @configdirector/react-web-sdk
main.tsx
import { createRoot } from "react-dom/client"
import App from "./App"
import { ConfigDirectorProvider } from "@configdirector/react-web-sdk";

createRoot(document.getElementById("root")!).render(
  <ConfigDirectorProvider sdkKey="YOUR-CLIENT-SDK-KEY">
    <App />
  </ConfigDirectorProvider>
);
npm install --save @configdirector/vue-sdk
main.ts
import { createApp } from "vue";
import App from "./App.vue";
import { ConfigDirectorPlugin } from "@configdirector/vue-sdk";

const app = createApp(App);

app.use(ConfigDirectorPlugin, { sdkKey: "YOUR-CLIENT-SDK-KEY" });

app.mount("#app");

3. Retrieve config values

main.ts (Use the client)
import { client } from "./config-director-setup"

// Retrieve the current value
const value = client.getValue("my-config-key", false);

// Subscribe to value updates
const unwatchMyKey = client.watch(
  "my-config-key",
  false,
  (newValue) => {
    console.log("Value updated:", newValue)
  },
);

unwatchMyKey(); // Call the unwatch function returned to remove the listener

client.unwatch("my-config-key"); // Removes all listeners for that key
YourComponent.tsx
import { useConfigValue } from "@configdirector/react-web-sdk";

function YourComponent() {
  const { value } = useConfigValue("my-config-key", false);

  return (<p>my-config-key: {value}</p>);
}

export default YourComponent;
YourComponent.vue
<script setup lang="ts">
import { useConfigValue } from "@configdirector/vue-sdk";

const { value } = useConfigValue("my-config-key", false);
</script>

<template>
  <div>my-config-key is : {{ value }}</div>
</template>

4. Configure user contexts and targeting rules

  1. With any of our SDKs you can provide an optional user context with attributes that can be leveraged in targeting rules. Choose your SDK for instructions on how to provide a user context:

A user context can be provided when initializing the client:

config-director-setup.ts
import { createClient } from "@configdirector/client-sdk";

export const client = createClient("YOUR-CLIENT-SDK-KEY");
await client.initialize({
  id: "12345",
  name: "Example User",
  traits: {
    region: "North America", // Any arbitrary traits which can be referenced in targeting rules
  }
});

The user context can also be updated via updateContext:

main.ts
import { client } from "./config-director-setup"

await client.updateContext({
  id: "654321",
  name: "Another User",
  traits: {
    region: "Australia",
  },
});

// Update it to `undefined` (anonymous user context) when a user signs out
await client.updateContext();

A user context can be provided when initializing the provider:

main.tsx
import { createRoot } from "react-dom/client"
import App from "./App"
import { ConfigDirectorProvider } from "@configdirector/react-web-sdk";

createRoot(document.getElementById("root")!).render(
  <ConfigDirectorProvider
    sdkKey="YOUR-CLIENT-SDK-KEY"
    context={{ id: "12345", name: "Example User", traits: { region: "North America" } }}>
    <App />
  </ConfigDirectorProvider>
);

The user context can also be updated with the useContext hook:

YourComponent.tsx
import { useConfigValue, useContext } from "@configdirector/react-web-sdk";

function YourComponent() {
  const { value: myConfigValue } = useConfigValue("my-config", "default value");
  const { updateContext } = useContext();

  useEffect(() => {
    updateContext({
      id: "654321",
      name: "Another User",
      traits: {
        region: "Australia",
      },
    });
  }, []);

  return (<p>My config value: {myConfigValue}</p>);
}

export default YourComponent;

A user context can be provided when initializing the plugin:

main.ts
import { createApp } from "vue";
import App from "./App.vue";
import { ConfigDirectorPlugin } from "@configdirector/vue-sdk";

const app = createApp(App);

app.use(ConfigDirectorPlugin, {
  sdkKey: "YOUR-CLIENT-SDK-KEY",
  context: {
    id: "12345",
    name: "Example User",
    traits: {
      region: "North America", // Any arbitrary traits which can be referenced in targeting rules
    },
  },
});

app.mount("#app");

The user context can also be updated via the useContext composable:

YourComponent.vue
<script setup lang="ts">
import { useConfigValue, useContext } from "@configdirector/vue-sdk";

const { updateContext } = useContext();
const { value } = useConfigValue("my-config-key", false);

const onUpdate = () => {
  updateContext({
    id: "654321",
    name: "Another User",
    traits: {
      region: "Australia",
    },
  });
};
</script>

<template>
  <div>my-config-key is : {{ value }}</div>
  <button type="button" @click="onUpdate">Update Context</button>
</template>
  1. You can now configure targeting rules by navigating to your config in the dashboard. Targeting rules are the very first tab on the config view:

Copyright © 2026