Add your first feature flag

Getting started with Bucket by adding your first feature flag

What's a feature?

A feature is an entity that Bucket uses to roll out features, manage access, track adoption and get feedback. Each feature has a feature key.

Getting started

  • Click New feature in the sidebar.

  • Give your feature a name, and you'll get a feature key. You can't change the feature key after creation. The feature key is like a flag key that can also be used for adoption and feedback.

  • If you haven't already, set up a Bucket SDK for your language and framework. Find the supported languages here.

Creating a new feature in Bucket

Code example

If you're using React and have created a feature called Huddle, it will look like the following:

import { useFeature } from "@bucketco/react-sdk";

function StartHuddleButton() {
  const { isLoading, isEnabled } = useFeature("huddle");

  if (isLoading) {
    return <Loading />;
  }

  if (!isEnabled) {
    return null;
  }

  return (
    <div>Huddles feature...</div>
  );
}

You can now use isEnabled to gate access to the feature.

Next steps

Last updated

Was this helpful?