<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jason Camp</title>
    <description>The latest articles on DEV Community by Jason Camp (@indienow).</description>
    <link>https://dev.to/indienow</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3639576%2F6c939bfb-4d55-46da-b878-226b1385416c.png</url>
      <title>DEV Community: Jason Camp</title>
      <link>https://dev.to/indienow</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/indienow"/>
    <language>en</language>
    <item>
      <title>How to Add Feature Flags to Your App in 5 Minutes</title>
      <dc:creator>Jason Camp</dc:creator>
      <pubDate>Mon, 01 Dec 2025 16:55:35 +0000</pubDate>
      <link>https://dev.to/indienow/how-to-add-feature-flags-to-your-app-in-5-minutes-13b5</link>
      <guid>https://dev.to/indienow/how-to-add-feature-flags-to-your-app-in-5-minutes-13b5</guid>
      <description>&lt;p&gt;Feature flags are one of those things that seem optional until you need to roll back a broken feature at 2am on a Saturday.&lt;/p&gt;

&lt;p&gt;Instead of reverting commits, redeploying, and praying — you just flip a toggle. Feature gone. Crisis over.&lt;/p&gt;

&lt;p&gt;Here's how to add feature flags to your app in about 5 minutes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What We're Building&lt;/strong&gt;&lt;br&gt;
A simple setup where you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Toggle features on/off instantly&lt;/li&gt;
&lt;li&gt;Roll out features to a percentage of users&lt;/li&gt;
&lt;li&gt;Use different settings per environment (dev/staging/prod)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Get Your API Key&lt;/strong&gt;&lt;br&gt;
For this tutorial, I'm using &lt;a href="https://setbit.io" rel="noopener noreferrer"&gt;SetBit&lt;/a&gt; — a feature flag service I built because I got tired of LaunchDarkly's complexity and pricing. Free tier works fine for this.&lt;/p&gt;

&lt;p&gt;Sign up, create a project, and grab your SDK key from Account → API Keys.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Install the SDK&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @setbit/js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or if you're using Python:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install setbit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Initialize&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { SetBit } from '@setbit/js';

const setbit = new SetBit({
  apiKey: 'your-sdk-key',
  environment: 'production'
});

await setbit.initialize();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Create Your First Flag&lt;/strong&gt;&lt;br&gt;
In the SetBit dashboard, click + Create Flag and set up:&lt;/p&gt;

&lt;p&gt;Name: new-checkout-flow&lt;br&gt;
Type: Boolean&lt;br&gt;
Default: false&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Use It In Your Code&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (setbit.isEnabled('new-checkout-flow')) {
  return &amp;lt;NewCheckout /&amp;gt;;
} else {
  return &amp;lt;OldCheckout /&amp;gt;;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Now you can toggle new-checkout-flow on or off from your dashboard — no redeployment needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Going Further: Percentage Rollouts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Want to test that new checkout with just 10% of users first?&lt;/p&gt;

&lt;p&gt;Change your flag type to Rollout and set the percentage. SetBit handles the consistent bucketing so the same user always gets the same experience.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Same code — rollout logic is handled server-side
if (setbit.isEnabled('new-checkout-flow', { userId: user.id })) {
  return &amp;lt;NewCheckout /&amp;gt;;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When to Use Feature Flags&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Risky deployments — Ship the code, enable the feature later&lt;/li&gt;
&lt;li&gt;A/B testing — Test variations with real users&lt;/li&gt;
&lt;li&gt;Kill switches — Instantly disable a broken feature&lt;/li&gt;
&lt;li&gt;Gradual rollouts — 10% → 50% → 100%&lt;/li&gt;
&lt;li&gt;Beta features — Enable only for specific users&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Real Win&lt;/strong&gt;&lt;br&gt;
The peace of mind. Ship on Friday. If something breaks, flip a toggle from your phone. No laptop required.&lt;/p&gt;

&lt;p&gt;I built SetBit for developers who want feature flags without the enterprise complexity or pricing. Free tier available if you want to try it. Feel free to contact me if you have any questions or feedback, I really appreciate it!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Jason&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devops</category>
      <category>tooling</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
