Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
bb70a7a
chore: update references from Bucket to Reflag across the codebase
pavkam Aug 25, 2025
b858d06
fix: update configuration file name and environment variable for API …
pavkam Aug 25, 2025
0002e23
refactor: rename features to flags and update related documentation
pavkam Aug 25, 2025
e0e6316
refactor: update references from Reflag to Bucket in feedback example…
pavkam Aug 25, 2025
1b12f18
refactor: rename feature references to flag in tests and implementation
pavkam Aug 25, 2025
5c6b806
refactor: update terminology from feature to flag across the codebase
pavkam Aug 27, 2025
ded4578
refactor: replace feature commands with flag commands in CLI
pavkam Aug 27, 2025
479514d
refactor: update terminology from feature to flag in evaluation logic
pavkam Aug 28, 2025
5d2444e
refactor: standardize flag terminology in tests and client implementa…
pavkam Aug 28, 2025
8b1ddb3
refactor: update types and methods to align with flag terminology
pavkam Aug 29, 2025
8348f07
Merge branch 'main' into reflag
pavkam Aug 29, 2025
738dac3
fix: update copyright information from Reflag ApS to Bucket ApS
pavkam Aug 29, 2025
b5eafed
refactor: rename Feature icon to Flag and update related imports
pavkam Aug 29, 2025
c29b292
refactor: update README and code to reflect flag terminology changes
pavkam Aug 29, 2025
5f9b565
refactor: update flag terminology and improve client logic
pavkam Sep 1, 2025
db7ff0a
refactor: standardize flag terminology and improve client implementation
pavkam Sep 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
cache: "yarn"
cache-dependency-path: "**/yarn.lock"
registry-url: "https://registry.npmjs.org"
scope: "@bucketco"
scope: "@reflag"
- name: Install dependencies
run: yarn install --immutable
- name: Build packages
Expand All @@ -44,6 +44,6 @@ jobs:
run: |
cd bucket-docs
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@bucket.co"
git config user.email "github-actions[bot]@reflag.com"
git add sdk
git commit -m "Update documentation" && git push || echo "No docs changes to commit"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ junit.xml

.next
eslint-report.json
bucket.config.json
reflag.config.json
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"booleanish",
"bucketco",
"openfeature",
"PKCE"
"PKCE",
"reflag",
"VITE"
]
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Bucket
# Reflag

Feature flags for SaaS that run on TypeScript. [Learn more and get started](https://bucket.co/)

Expand Down Expand Up @@ -27,21 +27,21 @@ Use this for Cloudflare Workers as well.

[Read the docs](packages/node-sdk/README.md)

## Bucket CLI
## Reflag CLI

CLI to interact with Bucket and generate types
CLI to interact with Reflag and generate types

[Read the docs](packages/cli/README.md)

## OpenFeature Browser Provider

Use Bucket with OpenFeature in the browser through the Bucket OpenFeature Browser Provider
Use Reflag with OpenFeature in the browser through the Reflag OpenFeature Browser Provider

[Read the docs](packages/openfeature-browser-provider/README.md)

## OpenFeature Node.js Provider

Use the Bucket with OpenFeature on the server in Node.js through the Bucket OpenFeature Node.js Provider
Use the Reflag with OpenFeature on the server in Node.js through the Reflag OpenFeature Node.js Provider

[Read the docs](packages/openfeature-node-provider/README.md)

Expand Down
2 changes: 1 addition & 1 deletion docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ typedoc --treatWarningsAsErrors
SEDCOMMAND='s/globals.md#(.*)-[0-9]+/globals.md#\1/g'

# Find all markdown files including globals.md
FILES=$(find dist/docs/@bucketco -name "*.md")
FILES=$(find dist/docs/@reflag -name "*.md")

echo "Processing markdown files..."
for file in $FILES
Expand Down
144 changes: 72 additions & 72 deletions packages/browser-sdk/FEEDBACK.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Bucket Feedback UI
# Reflag Feedback UI

The Bucket Browser SDK includes a UI you can use to collect feedback from user
about particular features.
The Reflag Browser SDK includes a UI you can use to collect feedback from user
about particular flags.

![image](https://github.com/bucketco/bucket-javascript-sdk/assets/34348/c387bac1-f2e2-4efd-9dda-5030d76f9532)

## Global feedback configuration

The Bucket Browser SDK feedback UI is configured with reasonable defaults,
The Reflag Browser SDK feedback UI is configured with reasonable defaults,
positioning itself as a [dialog](#dialog) in the lower right-hand corner of
the viewport, displayed in English, and with a [light-mode theme](#custom-styling).

These settings can be overwritten when initializing the Bucket Browser SDK:
These settings can be overwritten when initializing the Reflag Browser SDK:

```typescript
const bucket = new BucketClient({
publishableKey: "bucket-publishable-key",
const reflag = new ReflagClient({
publishableKey: "reflag-publishable-key",
user: { id: "42" },
feedback: {
ui: {
Expand Down Expand Up @@ -47,23 +47,23 @@ See also:

Automated feedback surveys are enabled by default.

When automated feedback surveys are enabled, the Bucket Browser SDK
will open and maintain a connection to the Bucket service. When a user
triggers an event tracked by a feature and is eligible to be prompted
for feedback, the Bucket service will send a request to the SDK instance.
By default, this request will open up the Bucket feedback UI in the user's
When automated feedback surveys are enabled, the Reflag Browser SDK
will open and maintain a connection to the Reflag service. When a user
triggers an event tracked by a flag and is eligible to be prompted
for feedback, the Reflag service will send a request to the SDK instance.
By default, this request will open up the Reflag feedback UI in the user's
browser, but you can intercept the request and override this behavior.

The live connection for automated feedback is established when the
`BucketClient` is initialized.
`ReflagClient` is initialized.

### Disabling automated feedback surveys

You can disable automated collection in the `BucketClient` constructor:
You can disable automated collection in the `ReflagClient` constructor:

```typescript
const bucket = new BucketClient({
publishableKey: "bucket-publishable-key",
const reflag = new ReflagClient({
publishableKey: "reflag-publishable-key",
user: { id: "42" },
feedback: {
enableAutoFeedback: false,
Expand All @@ -78,8 +78,8 @@ event arrives, you can can [override the global defaults](#global-feedback-confi
or intercept and override settings at runtime like this:

```javascript
const bucket = new BucketClient({
publishableKey: "bucket-publishable-key",
const reflag = new ReflagClient({
publishableKey: "reflag-publishable-key",
user: { id: "42" },
feedback: {
autoFeedbackHandler: (promptMessage, handlers) => {
Expand Down Expand Up @@ -114,32 +114,32 @@ See also:

## Manual feedback collection

To open up the feedback collection UI, call `bucketClient.requestFeedback(options)`
To open up the feedback collection UI, call `reflagClient.requestFeedback(options)`
with the appropriate options. This approach is particularly beneficial if you wish
to retain manual control over feedback collection from your users while leveraging
the convenience of the Bucket feedback UI to reduce the amount of code you need
the convenience of the Reflag feedback UI to reduce the amount of code you need
to maintain.

Examples of this could be if you want the click of a `give us feedback`-button
or the end of a specific user flow, to trigger a pop-up displaying the feedback
user interface.

### bucketClient.requestFeedback() options
### reflagClient.requestFeedback() options

Minimal usage with defaults:

```javascript
bucketClient.requestFeedback({
featureKey: "bucket-feature-key",
reflagClient.requestFeedback({
flagKey: "reflag-flag-key",
title: "How satisfied are you with file uploads?",
});
```

All options:

```javascript
bucketClient.requestFeedback({
featureKey: "bucket-feature-key", // [Required]
reflagClient.requestFeedback({
flagKey: "flag-key", // [Required]
userId: "your-user-id", // [Optional] if user persistence is
// enabled (default in browsers),
companyId: "users-company-or-account-id", // [Optional]
Expand Down Expand Up @@ -202,7 +202,7 @@ does not interact with it.

Using a dialog is a soft push for feedback. It lets the user continue their work
with a minimal amount of intrusion. The user can opt-in to respond but is not
required to. A good use case for this behavior is when a user uses a feature where
required to. A good use case for this behavior is when a user uses a flag where
the expected outcome is predictable, possibly because they have used it multiple
times before. For example: Uploading a file, switching to a different view of a
visualization, visiting a specific page, or manipulating some data.
Expand Down Expand Up @@ -244,8 +244,8 @@ Popover feedback button example:
<script>
const button = document.getElementById("feedbackButton");
button.addEventListener("click", (e) => {
bucketClient.requestFeedback({
featureKey: "bucket-feature-key",
reflagClient.requestFeedback({
flagKey: "reflag-flag-key",
userId: "your-user-id",
title: "How do you like the popover?",
position: {
Expand All @@ -261,7 +261,7 @@ Popover feedback button example:

By default, the feedback UI is written in English. However, you can supply your own
translations by passing an object in the options to either or both of the
`new BucketClient(options)` or `bucketClient.requestFeedback(options)` calls.
`new ReflagClient(options)` or `reflagClient.requestFeedback(options)` calls.
These translations will replace the English ones used by the feedback interface.
See examples below.

Expand All @@ -273,10 +273,10 @@ for a reference of what translation keys can be supplied.
### Static language configuration

If you know the language at page load, you can configure your translation keys while
initializing the Bucket Browser SDK:
initializing the Reflag Browser SDK:

```typescript
new BucketClient({
new ReflagClient({
publishableKey: "my-publishable-key",
feedback: {
ui: {
Expand Down Expand Up @@ -304,12 +304,12 @@ new BucketClient({
### Runtime language configuration

If you only know the user's language after the page has loaded, you can provide
translations to either the `bucketClient.requestFeedback(options)` call or
translations to either the `reflagClient.requestFeedback(options)` call or
the `autoFeedbackHandler` option before the feedback interface opens.
See examples below.

```typescript
bucketClient.requestFeedback({
reflagClient.requestFeedback({
... // Other options
translations: {
// your translation keys
Expand All @@ -319,16 +319,16 @@ bucketClient.requestFeedback({

### Translations

When you are collecting feedback through the Bucket automation, you can intercept
When you are collecting feedback through the Reflag automation, you can intercept
the default prompt handling and override the defaults.

If you set the prompt question in the Bucket app to be one of your own translation
If you set the prompt question in the Reflag app to be one of your own translation
keys, you can even get a translated version of the question you want to ask your
customer in the feedback UI.

```javascript
new BucketClient({
publishableKey: "bucket-publishable-key",
new ReflagClient({
publishableKey: "reflag-publishable-key",
feedback: {
autoFeedbackHandler: (message, handlers) => {
const translatedQuestion =
Expand All @@ -346,7 +346,7 @@ new BucketClient({

## Custom styling

You can adapt parts of the look of the Bucket feedback UI by applying CSS custom
You can adapt parts of the look of the Reflag feedback UI by applying CSS custom
properties to your page in your CSS `:root`-scope.

For example, a dark mode theme might look like this:
Expand All @@ -355,37 +355,37 @@ For example, a dark mode theme might look like this:

```css
:root {
--bucket-feedback-dialog-background-color: #1e1f24;
--bucket-feedback-dialog-color: rgba(255, 255, 255, 0.92);
--bucket-feedback-dialog-secondary-color: rgba(255, 255, 255, 0.3);
--bucket-feedback-dialog-border: rgba(255, 255, 255, 0.16);
--bucket-feedback-dialog-primary-button-background-color: #655bfa;
--bucket-feedback-dialog-primary-button-color: white;
--bucket-feedback-dialog-input-border-color: rgba(255, 255, 255, 0.16);
--bucket-feedback-dialog-input-focus-border-color: rgba(255, 255, 255, 0.3);
--bucket-feedback-dialog-error-color: #f56565;

--bucket-feedback-dialog-rating-1-color: #ed8936;
--bucket-feedback-dialog-rating-1-background-color: #7b341e;
--bucket-feedback-dialog-rating-2-color: #dd6b20;
--bucket-feedback-dialog-rating-2-background-color: #652b19;
--bucket-feedback-dialog-rating-3-color: #787c91;
--bucket-feedback-dialog-rating-3-background-color: #3e404c;
--bucket-feedback-dialog-rating-4-color: #38a169;
--bucket-feedback-dialog-rating-4-background-color: #1c4532;
--bucket-feedback-dialog-rating-5-color: #48bb78;
--bucket-feedback-dialog-rating-5-background-color: #22543d;

--bucket-feedback-dialog-submitted-check-background-color: #38a169;
--bucket-feedback-dialog-submitted-check-color: #ffffff;
--reflag-feedback-dialog-background-color: #1e1f24;
--reflag-feedback-dialog-color: rgba(255, 255, 255, 0.92);
--reflag-feedback-dialog-secondary-color: rgba(255, 255, 255, 0.3);
--reflag-feedback-dialog-border: rgba(255, 255, 255, 0.16);
--reflag-feedback-dialog-primary-button-background-color: #655bfa;
--reflag-feedback-dialog-primary-button-color: white;
--reflag-feedback-dialog-input-border-color: rgba(255, 255, 255, 0.16);
--reflag-feedback-dialog-input-focus-border-color: rgba(255, 255, 255, 0.3);
--reflag-feedback-dialog-error-color: #f56565;

--reflag-feedback-dialog-rating-1-color: #ed8936;
--reflag-feedback-dialog-rating-1-background-color: #7b341e;
--reflag-feedback-dialog-rating-2-color: #dd6b20;
--reflag-feedback-dialog-rating-2-background-color: #652b19;
--reflag-feedback-dialog-rating-3-color: #787c91;
--reflag-feedback-dialog-rating-3-background-color: #3e404c;
--reflag-feedback-dialog-rating-4-color: #38a169;
--reflag-feedback-dialog-rating-4-background-color: #1c4532;
--reflag-feedback-dialog-rating-5-color: #48bb78;
--reflag-feedback-dialog-rating-5-background-color: #22543d;

--reflag-feedback-dialog-submitted-check-background-color: #38a169;
--reflag-feedback-dialog-submitted-check-color: #ffffff;
}
```

Other examples of custom styling can be found in our [development example style-sheet](https://github.com/bucketco/bucket-javascript-sdk/tree/main/packages/browser-sdk/src/feedback/ui/index.css).

## Using your own UI to collect feedback

You may have very strict design guidelines for your app and maybe the Bucket feedback
You may have very strict design guidelines for your app and maybe the Reflag feedback
UI doesn't quite work for you. In this case, you can implement your own feedback
collection mechanism, which follows your own design guidelines. This is the data
type you need to collect:
Expand All @@ -401,18 +401,18 @@ type DataToCollect = {
```

Either `score` or `comment` must be defined in order to pass validation in the
Bucket API.
Reflag API.

### Manual feedback collection with custom UI

Examples of a HTML-form that collects the relevant data can be found
in [feedback.html](https://github.com/bucketco/bucket-javascript-sdk/tree/main/packages/browser-sdk/example/feedback/feedback.html) and [feedback.jsx](https://github.com/bucketco/bucket-javascript-sdk/tree/main/packages/browser-sdk/example/feedback/Feedback.jsx).

Once you have collected the feedback data, pass it along to `bucketClient.feedback()`:
Once you have collected the feedback data, pass it along to `reflagClient.feedback()`:

```javascript
bucketClient.feedback({
featureKey: "bucket-feature-key",
reflagClient.feedback({
flagKey: "flag-key",
userId: "your-user-id",
score: 5,
comment: "Best thing I've ever tried!",
Expand All @@ -421,23 +421,23 @@ bucketClient.feedback({

### Intercepting automated feedback survey events

When using automated feedback surveys, the Bucket service will, when specified,
send a feedback prompt message to your user's instance of the Bucket Browser SDK.
When using automated feedback surveys, the Reflag service will, when specified,
send a feedback prompt message to your user's instance of the Reflag Browser SDK.
This will result in the feedback UI being opened.

You can intercept this behavior and open your own custom feedback collection form:

```typescript
new Bucketclient({
publishableKey: "bucket-publishable-key",
new ReflagClient({
publishableKey: "reflag-publishable-key",
feedback: {
autoFeedbackHandler: async (promptMessage, handlers) => {
// This opens your custom UI
customFeedbackCollection({
// The question configured in the Bucket UI for the feature
// The question configured in the Reflag UI for the flag
question: promptMessage.question,
// When the user successfully submits feedback data.
// Use this instead of `bucketClient.feedback()`, otherwise
// Use this instead of `reflagClient.feedback()`, otherwise
// the feedback prompt handler will keep being called
// with the same prompt message
onFeedbackSubmitted: (feedback) => {
Expand Down
Loading
Loading