Build-time logic snapshot

To improve reliability, you can include a fallback snapshot of your flag logic in the generated client at build time. The SDK will instantly initialize from the snapshot first before fetching the latest flag logic from Hypertune Edge.

You can keep the snapshot fresh by setting up a webhook 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 single-page apps (SPAs) as you can use your flags in the first app render without any page load delay, UI flicker or layout shift.

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:

HYPERTUNE_INCLUDE_INIT_DATA=true

2. Regenerate the client

Regenerate the client. The generated client now includes a fallback snapshot of your flag logic.

Last updated