When we talk to fellow Intercom users, we love to share the different ways we use Intercom to power our business. When we get to the part about managing feature flags, people are often surprised and curious.
Let's take a look at how you can use Intercom to manage your feature rollouts. But first, some background...
What's a feature flag?
A feature flag (also called a toggle, gate, or switch) enables software teams to roll out feature access independently from code deployments. Translation: your team can deploy a new feature, but access to the feature can be turned on and off dynamically.
Okay, got it. But why?
Feature flags let you ship faster with reduced risk and increased control. They're great for rolling out mission-critical changes and beta testing new features, as you can slowly increase traffic to the new code. If you spot a problem, you can turn it off entirely, all without deploying.
For more on how and when you might use feature flags, check out Martin Fowler's guide.
How to use Intercom to manage feature flags
So let's say you want to release a new feature behind a feature flag. How do you check to see who should have access? Here are some popular places to store and look up feature flags:
- A configuration file that lives alongside your code. This works well for static flags but isn't well-suited to dynamic flags that may change per customer.
- Your application database. This is often easiest, but not always optimal.
- A separate datastore (like Redis). This is a popular choice since keeps configuration data separate from application data and is also very fast.
Let's assume you've got a datastore in place for your feature flags. Great! You've got feature checks in your code and a place to store and query them, but you still need a way to actually manage which customers can use the new feature.
Enter Intercom tags.
Assuming you're pushing your user and company data into Intercom, you can tag these entities to toggle a feature on or off. Intercom becomes the admin interface for your feature flags. This empowers product and support teams, keeps feature rollout decisions close to the customer, and avoids developer disruption.
A practical example
We're currently beta testing our new Messages feature, which lets you send Intercom messages to users who have given you feedback directly from the Userfeed admin UI. We'd like to iron out a few wrinkles and ensure our messages are sent properly via Intercom's API, so we put this feature behind a feature flag.
With the code deployed, enabling the feature is as simple as tagging a user in Intercom:
When the user is tagged, Intercom sends a webhook (using the aptly named
user.tag.created webhook topic). Our app gets notified and adds the newly-tagged user to the feature in our flag configuration.
And just like that, the user can use the new feature. Without leaving Intercom, product and support teams can toggle on and off access to the beta!
The power of Intercom
Linking feature access to Intercom tags enables some pretty powerful workflows. Got an ideal customer profile in mind for your new feature? Filter your user list in Intercom and bulk tag those that fit the profile. Need feedback from beta testers? Simply send an Intercom message to all users with the feature tag. Want to automate beta rollout? Use a custom bot where the opt-in path adds the feature tag to a user.
Bringing feature flags into Intercom arms your team with admin capabilities, improves rollout decisions using customer data, and enhances your message targeting. Give it a try and let us know how it goes!
If you'd like to get updates when we post more Intercom templates and use cases like this, drop us your info and we'll keep you in the loop: