Why This Matters

Feature flagging is a cornerstone of modern deployment strategies. Until now, setting up weighted splits for Vercel Flags required manual dashboard configuration or third-party tools. The new vercel flags split command brings this power directly to your terminal, making it faster and more scriptable for CI/CD pipelines.

This is especially useful for:

  • Gradual rollouts (e.g., 5% of users see a new checkout)
  • A/B testing with precise user bucketing
  • Canary releases tied to user attributes

The command is part of the latest Vercel CLI update. Read the official changelog for the full announcement.

How It Works

The split is defined per flag and per environment. You specify a bucketing attribute (like user.id or session_id) and assign weights to each variant. The total must equal 100.

Basic Interactive Mode

Just run:

vercel flags split redesigned-checkout

CLI will prompt you for environment, attribute, and weights.

Non-Interactive (Script-Friendly)

Pass everything as flags:

vercel flags split redesigned-checkout \
  --environment production \
  --by user.id \
  --weight off=95 \
  --weight on=5

This sets a 95/5 split for the redesigned-checkout flag in production, bucketing by user.id. The off variant gets 95% of traffic, on gets 5%.

Vercel CLI terminal showing weighted traffic split configuration for feature flags Dev Environment Setup

Real-World Example: Canary Release

Imagine you're rolling out a new payment flow. You want to test it on a small subset of users before full release.

vercel flags split new-payment-flow \
  --environment production \
  --by user.id \
  --weight old=90 \
  --weight new=10

Then, in your app code, check the flag:

import { get } from '@vercel/flags';

const paymentFlow = await get('new-payment-flow');
if (paymentFlow === 'new') {
  // render new payment component
} else {
  // render old payment component
}

You can monitor error rates and conversion metrics. If everything looks good, adjust the split to 50/50, then 100% new.

Limitations & Caveats

  • Consistency is key: The bucketing attribute must be stable for a given user (e.g., user.id). Using ip may cause inconsistent experiences if the user's IP changes.
  • Weights must sum to 100: The CLI enforces this, but double-check when scripting.
  • Environment-specific: Splits are per environment. You'll need to configure each one separately (staging, production, etc.).
  • No real-time adjustment: Changes take effect on the next flag evaluation, not instantly. Plan for a short propagation delay.

Developer using Vercel Flags split command in production environment Programming Illustration

Comparison with Other Platforms

FeatureVercel Flags (CLI)LaunchDarklySplit.io
CLI-based split config✅ Native❌ API only❌ API only
Bucketing by user attribute✅ Yes✅ Yes✅ Yes
Interactive mode✅ Yes❌ No❌ No
CI/CD friendly✅ Yes✅ Yes (API)✅ Yes (API)
Dashboard required❌ No✅ Yes✅ Yes

Vercel's approach is unique because it eliminates the need to leave the terminal. For teams that live in the CLI, this is a huge productivity boost.

Next Steps

  1. Update your Vercel CLI to the latest version (vercel update).
  2. Try the interactive mode on a test flag.
  3. Integrate the non-Interactive command into your CI/CD pipeline for canary deployments.

For deeper platform comparisons, check out our analysis of Cloudflare Sandboxes and Containers Are Now GA A Deep Dive into the New Features and Beyond Notebooks Accelerating ML/AI Development with Metaflows New Spin Feature.

Final Thoughts

Weighted traffic splits from the CLI might seem like a small addition, but it signals a shift toward developer-first feature management. By reducing friction, Vercel makes it easier to adopt safe deployment practices. Give it a try on your next feature flag.

Diagram of A/B test traffic distribution with 95/5 weight split on user.id IT Technology Image

This content was drafted using AI tools based on reliable sources, and has been reviewed by our editorial team before publication. It is not intended to replace professional advice.