Getting started

Welcome! Bucket is feature flags that helps you ship the right features faster.

Let's get started. We'll do the following:

  1. Create your first feature.

  2. Set up a Bucket SDK for your language and framework or use our HTTP API

  3. Set feature access rules.

  4. Get feedback to fix customer issues.

Prerequisites

First off, you need to create an account. Do so in the Bucket UI or use the CLI:

npm i @bucketco/cli -D && npx bucket new

1. Create your first feature

Now let's create your first feature. Use the CLI, Bucket UI or our MCP within your editor.

CLI:

npx bucket new

Bucket UI:

  1. Click New feature in the sidebar.

  2. Give your feature a name, and we'll suggest a feature key .

Next, let's set up a Bucket SDK for your language and framework.

2. Install the Bucket SDK

Find the supported languages below:

Code example for React

If you've installed the React SDK and have created a feature called my-new-feature, getting started will look like the following:

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

const MyFeature = () => {
  const { isEnabled } = useFeature("my-new-feature");

  return isEnabled ? "You have access!" : null;
};

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

3. Set access rules

Head back over to your dashboard, select your feature and the Access tab.

From here, you can define segments, companies, and users that will access your feature.

4. Get feedback

You can get feedback by adding a static "Feedback" button or you can trigger a survey, at the right time.

To add a button, simply add requestFeedback, like so:

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

const MyFeature = () => {
  const { isEnabled, requestFeedback } = useFeature("my-new-feature");

  if (!isEnabled) {
    return null;
  }

  return (
    <>
      <button>Use feature</button>
      <button
        onClick={() => requestFeedback({ title: "How do you like this new feature?" })}
      >
        Give feedback
      </button>
    </>
  );
}

5. Track feature adoption

To track adoption of your new feature, use track:

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

const MyFeature = () => {
  const { isEnabled, requestFeedback, track } = useFeature("my-new-feature");

  if (!isEnabled) {
    return null;
  }

  return (
    <>
      <button onClick={() => track()}>Use feature</button>
      <button
        onClick={() => requestFeedback({ title: "How do you like this new feature?" })}
      >
        Give feedback
      </button>
    </>
  );
}

Get support

Last updated

Was this helpful?