# Build-time snapshot

To improve reliability, you can include a fallback snapshot of your flag logic in the [generated client](/sdk-reference/type-safe-client-generation.md) at build time. The SDK will instantly initialize from the snapshot first before fetching the latest flag logic from [Hypertune Edge](/concepts/hypertune-edge.md).

To keep the snapshot fresh, set up a [webhook](/integrations/webhooks.md) to regenerate the client on every Hypertune commit. In this case, you don't need to initialize from Hypertune Edge at all, eliminating network latency and bandwidth, improving both performance and efficiency.

The snapshot is particularly useful for SPAs (single-page applications) as you can use your flags in the first app render without any layout shift, flickering, or page load delay.

It also enables using Hypertune in local-only, offline mode, e.g. for running unit tests, or in isolated, secure, air-gapped environments.

## 1. Set environment variable

Set the `HYPERTUNE_INCLUDE_INIT_DATA` environment variable:

```bash
HYPERTUNE_INCLUDE_INIT_DATA=true
```

## 2. Regenerate the client

[Regenerate the client](/sdk-reference/type-safe-client-generation.md). The generated client now includes a fallback snapshot of your flag logic.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hypertune.com/sdk-reference/build-time-snapshot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
