@bucketeer/node-server-sdk

中文文档
0.4.7发布于 2026/08/07Apache-2.0TypeScriptCommonJS构建来源已验证近 30 天下载 4.5万

npm version

原始使用文档
文档目录9 节
  1. Installation
  2. Contributing
  3. Example
  4. Build and start an example server
  5. Development
  6. Setup
  7. SDK
  8. Publish to npm
  9. Write tests

npm version

Bucketeer Server-Side SDK for Node.js

Bucketeer is an open-source platform created by CyberAgent to help teams make better decisions, reduce deployment lead time and release risk through feature flags. Bucketeer offers advanced features like dark launches and staged rollouts that perform limited releases based on user attributes, devices, and other segments.

Getting started using Bucketeer SDK.

Installation

See our documentation to install the SDK.

Contributing

We would ❤️ for you to contribute to Bucketeer and help improve it! Anyone can use and enjoy it!

Please follow our contribution guide here.

Example

Before building the example, please follow the following steps.

  • Ensure that you have the yarn installed.
  • Configure the apiEndpoint (with URL scheme like https://) and the apiKey info in the index.ts.
  • Move to the example directory cd example.
  • Install dependencies make init.

Build and start an example server

make start

If you want to use a published SDK instead of a local one, replace the line where it imports the library in the example code

Development

Setup

Install the prerequisite tools.

Setup node version

Please look at the .nvmrc file to check the node version.

nvm use

Install dependencies

make init

SDK

Format

make fmt

Lint & Type check

make lint
make type-check

Build

make build

Run unit tests

make test

Run e2e tests

Set the required secrets for E2E tests using environment variables or a .env file in the project root. The following variables are required, except for SCHEME, which is optional and defaults to https:

  • API_ENDPOINT (e.g. api.example.com, without scheme)
  • SCHEME (optional; e.g. https or http, defaults to https)
  • CLIENT_API_KEY (Client SDK role API key)
  • SERVER_API_KEY (Server SDK role API key for testing with local evaluate)

You can create a .env file in the project root for local development:

API_ENDPOINT=your.api.endpoint
SCHEME=https
CLIENT_API_KEY=your-client-key
SERVER_API_KEY=your-server-key

The E2E test config will automatically load these values.

Then run:

make e2e

Publish to npm

Add the version field to package.json, then run the following command.

export NPM_TOKEN=<YOUR_NPM_TOKEN>
make publish

Write tests

  • Write tests in the src/__tests__ directory. The test files should following snake_case naming convention. Its differ from the library code which uses camelCase.
  • Use ava as the test runner. You can find the configuration in the ava.config.mjs file.
  • Run all tests using make test command.
  • Run single test using make test-single <path-to-test-file> command.

Note: The publishing process is automated using GitHub Actionshttps://github.com/bucketeer-io/node-server-sdk/blob/master/.github/workflows/release.yml to publish it when the released tag is created.

版本与发布记录

@bucketeer/node-server-sdk 共发布 16 个版本,首次发布于 2021/12/23;过去 12 个月发布了 5 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.4.7latest2026/08/073 个月前
0.4.62026/06/174 个月前
0.4.52026/01/209 个月前
0.4.42025/11/2111 个月前
0.4.32025/11/1911 个月前
0.4.22025/10/211 年前

关于 @bucketeer/node-server-sdk 的常见问题

如何安装 @bucketeer/node-server-sdk?

在项目目录运行 npm install @bucketeer/node-server-sdk,或使用 pnpm add / yarn add / bun add。

@bucketeer/node-server-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bucketeer/node-server-sdk 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@bucketeer/node-server-sdk 可以商用吗?

@bucketeer/node-server-sdk 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@bucketeer/node-server-sdk 的下载量有多少?

根据 npm 官方下载统计,@bucketeer/node-server-sdk 在 2026/10/09 – 2026/11/07 这 30 天内被下载 45,371 次,日均约 1,512 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bucketeer/node-server-sdk 还在维护吗?

最新版本 0.4.7 发布于 2026/08/07(3 个月前);至今共发布 16 个版本,其中过去 12 个月发布了 5 个;首次发布于 2021/12/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。