> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useshipd.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Turn a feature off immediately

> Use a boolean flag as a kill switch: set Fallthrough to false, remove rules that serve true, and know how fast clients see it.

## Overview

To turn a feature off for everyone, make the flag serve `false` in that environment: set **Fallthrough** to `false` and remove any rules that serve `true`. SDK clients pick up the change within seconds when streaming is on, or on their next poll.

## Turn it off

**1. Open the flag**

In the [dashboard](https://app.useshipd.com), open the project, click the flag (for example `new-checkout`), and select the environment, for example `production`.

**2. Serve false**

Set **Fallthrough** to `false`. **Remove** every rule that serves `true`, or change its **Serve** to `false`.

**3. Save**

Click **Save environment**.

> [!WARNING]
>
> Switching **Enabled in production** off does not turn a boolean flag off by itself. A disabled flag skips its rules and serves the **Fallthrough** value to everyone. If **Fallthrough** is `true`, a disabled flag keeps serving `true`. Always set **Fallthrough** to the off value.

Switching **Enabled in \<environment>** off is still useful when **Fallthrough** is already `false`: it stops every rule from matching in one click, without deleting the rules.

## How fast it takes effect

| Client setup | Time to see the change |
| - | - |
| TypeScript: `stream: true` | Normally within seconds when a WebSocket implementation is available. The notification triggers a snapshot fetch; polling continues as a backup unless disabled. |
| TypeScript: polling only | Next successful poll: `refreshIntervalMs` (default 30 seconds) after the previous fetch finishes, plus fetch time. Failures can delay it further. |
| TypeScript: `refreshIntervalMs: 0` without `stream: true` | Only on manual `refresh()` or restart. Don't use this for flags you may need to kill. |
| Go: polling | Next successful poll on the `RefreshInterval` schedule (default 30 seconds), plus fetch time. Slow or failed requests can delay it further. |
| Go: `DisablePolling: true` | Only on manual `Refresh(ctx)` or restart. |

```ts TypeScript theme={null}
// src/lib/shipd.ts
export const shipd = createClient<FlagDefinitions>({
  sdkKey: process.env.SHIPD_SDK_KEY!,
  stream: true,
  defaults: { "new-checkout": false },
});
```

```go Go theme={null}
// flags.go
client, err := shipd.New(shipd.Options{
    SDKKey: os.Getenv("SHIPD_SDK_KEY"),
    RefreshInterval: 5 * time.Second,
    Defaults: map[string]any{"new-checkout": false},
})
if err != nil { return err }
defer func() {
    ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
    defer cancel()
    if err := client.Shutdown(ctx); err != nil { log.Printf("shipd events: %v", err) }
}()
```

See [Local evaluation](/concepts/local-evaluation) for how snapshots refresh.

## Make the code default the safe value

When the SDK has no snapshot (before `ready()`, or when the edge is unreachable with no cache), it serves the client `defaults`. Write flags so the default is the safe state:

```ts TypeScript theme={null}
// Good: false means the risky path is off
if (shipd.isEnabled("new-checkout", { userId })) {
  return renderNewCheckout();
}
return renderLegacyCheckout();
```

```go Go theme={null}
if client.IsEnabled("new-checkout", shipd.EvaluationContext{UserID: userID}) {
    return renderNewCheckout()
}
return renderLegacyCheckout()
```

Keep `default: false` in your flag definitions too. `shipd push` sets **Fallthrough** in the target environment to the config `default`, so a config that says `true` would turn the feature back on at the next push.

## Approvals

If an [approval policy](/operations/approvals) protects the environment, **Save environment** can create a pending request instead of changing the live flag. The feature stays on until the request is approved. Plan for this before an incident: make sure enough reviewers are available, or keep a policy that lets on-call staff approve quickly.

## Related

* [Create a boolean flag](/flags/boolean)
* [Why isn't my flag updating?](/resources/troubleshooting)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.