$ npm install @vercel/prepare-flags-definitions@vercel/prepare-flags-definitionsA build-time utility for Vercel Flags that fetches flag definitions and bundles them into a synthetic @vercel/flags-definitions package inside node_modules. This allows @vercel/flags-core to access flag definitions instantly at runtime, even when the network is unavailable.
This package is used by the Vercel CLI and other build tools. You typically do not need to install it directly.
npm i @vercel/prepare-flags-definitions
import { prepareFlagsDefinitions } from '@vercel/prepare-flags-definitions';
const result = await prepareFlagsDefinitions({
cwd: process.cwd(),
env: process.env,
userAgentSuffix: 'my-build-tool/1.0.0',
});
if (result.created) {
console.log(`Bundled definitions for ${result.sdkKeysCount} SDK keys`);
} else {
console.log(`No definitions created: ${result.reason}`);
}
vf_server_* or vf_client_*)flags.vercel.com for each keynode_modules/@vercel/flags-definitions/At runtime, @vercel/flags-core imports this module as a fallback when streaming or polling is unavailable.