Getting started

Getting started with Bucket

Let's get started with Bucket. 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 access rules to roll out features gradually to certain segments and/or environments

Let's go.

0. Prerequisites

First off, you need to sign up for Bucket.

Pro tip: Install Bucket CLI to add feature flags from the command line. Run the following command:

# npm
npm install --save-dev @bucketco/cli

# yarn
yarn add --dev @bucketco/cli

1. Create your first feature

Now let's create your first feature.

Navigate to your project's root directory, then running the new command to initialize the CLI, create a feature, and generate the types all at once:

# npm
npx bucket new

# yarn
yarn bucket new

You can use the Bucket Dashboard, too:

  1. Click New feature in the sidebar.

  2. Give your feature a name, and we'll suggest a feature key (Fig. 1).

Fig. 1: Create a new feature on bucket.co

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

2. Install the Bucket SDK

Find the supported languages below:

Cover

Feature flagging and evaluation for React

Cover

Client-side feature flagging and evaluation

Cover

Server-side feature flagging and evaluation

Cover

Feature flagging and evaluation for Next.js

Cover

Bucket supports OpenFeature

Cover

Don't use these languages or frameworks? Use our API

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.

See the respective SDK documentation for example for other SDKs.

3. Set access rules

Head back over to your dashboard, select your feature and the Access tab (Fig. 2).

Fig. 2: Access rules on bucket.co

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

4. All set!

Frequently asked question:

  • Is it that simple? Yep. Enjoy!

5. Next steps

Bucket is purpose-built for B2B SaaS products. There's more.

6. Get support

Last updated

Was this helpful?