
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@flags-sdk/hypertune
Advanced tools
The [Hypertune adapter](https://flags-sdk.dev/docs/api-reference/adapters/hypertune) for the [Flags SDK](https://flags-sdk.dev/)
The Hypertune adapter for the Flags SDK
The Hypertune provider is available in the @flags-sdk/hypertune module. You can install it with
pnpm i @flags-sdk/hypertune
You must use the code generation powered by npx hypertune to create an adapter instance.
Use createHypertuneAdapter from @flags-sdk/hypertune as shown below:
import { createHypertuneAdapter } from "@flags-sdk/hypertune";
import { Identify } from "flags";
import { dedupe, flag } from "flags/next";
/** Generated with `npx hypertune` */
import {
createSource,
flagFallbacks,
vercelFlagDefinitions as flagDefinitions,
Context,
FlagValues,
} from "./generated/hypertune";
const identify: Identify<Context> = dedupe(async ({ headers, cookies }) => {
return {
environment: process.env.NODE_ENV,
user: {
id: "e23cc9a8-0287-40aa-8500-6802df91e56a",
name: "Example User",
email: "user@example.com",
},
};
});
const hypertuneAdapter = createHypertuneAdapter<FlagValues, Context>({
createSource,
flagFallbacks,
flagDefinitions,
identify,
});
/** Use the adapter to generate flag declarations for use in your app's framework */
export const showSummerBannerFlag = flag(
hypertuneAdapter.declarations.summerSale,
);
export const showFreeDeliveryBannerFlag = flag(
hypertuneAdapter.declarations.freeDelivery,
);
export const proceedToCheckoutColorFlag = flag(
hypertuneAdapter.declarations.proceedToCheckout,
);
/**
* NOTE: You can provide specific options for flag overrides.
*
* However, using enums in Hypertune will provide these automatically.
*/
export const delayFlag = flag({
...hypertuneAdapter.declarations.delay,
options: [
{ value: 0, label: "No delay" },
{ value: 1_000, label: "1 second" },
{ value: 2_000, label: "2 seconds" },
{ value: 3_000, label: "3 seconds" },
],
});
# Required
NEXT_PUBLIC_HYPERTUNE_TOKEN="123="
# For use with precompute, encrypted flag values, overrides, and the Flags Explorer
FLAGS_SECRET="ReplaceThisWith32RandomBytesBase64UrlString"
# Optional: automatically configure with a VercelEdgeConfigInitDataProvider
EXPERIMENTATION_CONFIG="ecfg_abc"
EXPERIMENTATION_CONFIG_ITEM_KEY="hypertune_xyz"
Please check out the Hypertune Adapter reference for more information.
FAQs
The [Hypertune adapter](https://flags-sdk.dev/docs/api-reference/adapters/hypertune) for the [Flags SDK](https://flags-sdk.dev/)
The npm package @flags-sdk/hypertune receives a total of 4,099 weekly downloads. As such, @flags-sdk/hypertune popularity was classified as popular.
We found that @flags-sdk/hypertune demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.