entitlement blog

How to use feature flags to manage entitlements without writing code

fynn
Fynn Glover
·
10/16/2024

Managing entitlements in a SaaS application can be complex, especially when customers require access to different features based on their subscription plans. Traditionally, this requires a significant amount of custom code to handle user access. However, with Schematic’s feature flag system, you can manage entitlements dynamically—without writing a single line of code.

This guide will walk you through how to use Schematic’s feature flags to manage entitlements in your application, making it easier to control feature access and reduce the burden on your engineering team.


What Are Feature Flags in Schematic?

Feature flags in Schematic act as switches that control user access to specific features or services within your application. By associating feature flags with entitlements, you can easily define which users have access to certain features based on their subscription plan.

Here’s how the process works:

  • Define Entitlements: Determine the features available in each of your subscription plans.

  • Set Feature Flags: Assign feature flags to control access to these features.

  • Evaluate Flags in Real-Time: Your application checks these flags to determine what a user can and cannot access.

Image

Step-by-Step: Managing Entitlements with Feature Flags

Let’s walk through a typical use case of managing feature access based on a user’s subscription plan using Schematic’s feature flags.

Step 1: Create a Subscription Plan

First, ensure that your subscription plans are set up in Schematic. Each plan represents a tier of access that your customers can subscribe to, such as "Basic", "Pro", or "Enterprise."

  • Navigate to the Catalog section of Schematic.

  • Select Create Plan and define the name and billing details for the plan.

  • Link this plan to a Stripe Product to ensure that it syncs with customer subscriptions.

Image

Step 2: Set Up Feature Flags for Entitlements

Once your plans are in place, you can start setting up feature flags to control access to features based on user entitlements. In Schematic, this is done by linking features (or entitlements) to the subscription plans through flags.

  • Go to the Features section and select Create Feature.

  • Name the feature (e.g., "Advanced Analytics" or "Custom Reports") and choose the type of feature (Boolean, Event-based, or Trait-based).

  • Set the flag key, which will be referenced in your application.

Image

Step 3: Assign Features to Plans

Once your feature flags are created, the next step is to assign, or entitle, them to specific plans. For example, you may want the "Advanced Analytics" feature to only be available to "Pro" and "Enterprise" plan users.

  • Navigate to the Catalog and select the plan you want to manage.

  • Under Plan Entitlements, add the feature flag to the plan by selecting it from the list of available flags.

  • Define any limits or usage caps for the feature if needed (e.g., a limited number of API requests per month for a metered feature).

Image

Step 4: Check Feature Flags in Your Application

Once your feature flags are set up and assigned to plans, your application can check the flags at runtime to determine what users have access to. Schematic’s SDKs make this simple by allowing your application to evaluate flags with minimal effort.

  • Initialize Schematic’s SDK in your application using your API keys.

  • Use the checkFlag method in the SDK to evaluate feature flags for a user.

For example, in React:

Image

This ensures that only users with the correct entitlements have access to the feature.


Benefits of Using Feature Flags for Entitlements

Using feature flags to manage entitlements offers several key benefits:

  1. No Code Changes Required: Once integrated, you can adjust access to features by simply updating flags in the Schematic dashboard. There’s no need to redeploy your application.

  2. Flexible Pricing and Packaging: Quickly experiment with new pricing models and feature bundles by adding or removing entitlements dynamically.

  3. Simplified Customer Management: Feature flags make it easy to roll out or restrict features to specific customer segments without manually updating user data or permissions in your codebase.

  4. Reduced Engineering Overhead: By managing entitlements in Schematic, you offload the complexity of maintaining homegrown entitlement systems, allowing your team to focus on building product features instead of billing logic.


Next Steps

Now that you’ve seen how easy it is to manage entitlements using feature flags in Schematic, here are some next steps:

  • Start by setting up your own feature flags and entitlements for a few key features.

  • Explore Schematic’s Metering capabilities to track feature usage and support usage-based billing models.

  • Experiment with rolling out a new feature to a subset of users by targeting a feature flag to specific audiences.

For more detailed guidance, check out our documentation or reach out to our support team for a personalized demo.

______

Don't waste time building & maintaining admin panels, feature flags, entitlements, and all the UX beyond basic checkout. We call this "the last mile of pricing & packaging." None of it is core to your product, and we're building Schematic to be the fastest way to implement pricing & packaging into your app.