@boulevard/blvd-book-sdk

中文文档
2.0.10发布于 2025/09/24UNLICENSEDTypeScriptES Module近 30 天下载 2595

A JS client for the Boulevard API

原始使用文档
文档目录12 节
  1. Boulevard Book Software Development Kit
  2. About the project
  3. Getting Started
  4. Setup
  5. Client-Side
  6. Documentation
  7. Development
  8. Refresh Sched bindings
  9. Run tests
  10. Deployment
  11. Contributing
  12. Issues

TypeScript GitHub license GitHub release PRs Welcome

Boulevard Book Software Development Kit

Report a Bug · Request a Feature

Table of Contents
  1. Getting Started
  2. Documentation
  3. Development
  4. Contributing
  5. Issues

About the project

Boulevard is an intelligent scheduling solution and comprehensive point of sale system that increases revenue and lowers costs for salons, spas, and other appointment-based businesses.

With this software development kit (SDK) you can create your own custom booking experiences for your business using Boulevard.

Getting Started

Setup

Head over to the Boulevard Developer Portal to get set up with a sandbox account and API application. You'll need your business ID and and API key to use this package.

const businessId = "312bf55a-b6c5-48f2-ab40-eef5d78277ac";
const apiKey = "00000000-0000-0000-0000-000000000000";

Install the SDK

npm --save install @boulevard/blvd-book-sdk
yarn add @boulevard/blvd-book-sdk

Client-Side

The simplest flow is the unauthenticated client API, which you can use to create an appointment for a new client:

import { Blvd } from "@boulevard/blvd-book-sdk";

// Step 1: Create a `business` object to interact with the API.
const client = new Blvd(apiKey, businessId);

// Step 2: Choose a location and start by creating a cart
const business = await client.businesses.get();
const locations = await business.getLocations();

let cart = await client.carts.create(locations[0]);

// Step 3: Select and add items to the card
const item = cart.availableCategories[0].availableItems[0];
cart = await cart.addBookableItem(item);

// Step 4: Find available timeslots
const dates = await cart.getBookableDates();
const times = await cart.getBookableTimes(dates[0]);

// Step 5: Reserve a timeslot, add details, and book!
await cart.reserve(times[0]);

await cart.update({
  email: "[email protected]",
  firstName: "John",
  lastName: "Doe",
  phoneNumber: "+13105555555"
});

await cart.addCardPaymentMethod({
  card: {
    name: "John Doe",
    number: "4242424242424242",
    cvv: "111",
    exp_month: 1,
    exp_year: 2028,
    address_postal_code: "90210"
  }
});

await cart.checkout();

Documentation

Package documentation is available here.

To see available API operations browse the methods tied to class definitions. Example - Cart operations

Development

Refresh Sched bindings

This will fetch the graphql schema from Sched and generate the typescript bindings and mocks.

npm run gen
yarn run gen

Run tests

To be able to run tests you need ts-node installed globaly

npm -g install ts-node
yarn global add ts-node

Then you can run the tests.

npm test
yarn test

Deployment

Note, unless you're a Boulevard employee you'll need to open a PR and seek approval for your changes to be included in a release.

You'll first need to ask to be added to the Boulevard organisation at npmjs.com. Once you have been added run the following commands:

yarn build && yarn publish
yarn run typedoc

Then Commit and push (inc tags).

Contributing

Pull requests are welcome. See the contribution guidelines for more information.

Issues

If you encounter any problems while trying to run the starter kit please create an issue.

版本与发布记录

@boulevard/blvd-book-sdk 共发布 62 个版本,首次发布于 2021/06/21;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.0.10latest2025/09/241.1 年前
2.0.92025/02/111.7 年前
2.0.82025/01/141.8 年前
2.0.62025/01/111.8 年前
2.0.22023/11/162 年前
2.0.02023/11/162 年前

关于 @boulevard/blvd-book-sdk 的常见问题

@boulevard/blvd-book-sdk 是什么?

A JS client for the Boulevard API

如何安装 @boulevard/blvd-book-sdk?

在项目目录运行 npm install @boulevard/blvd-book-sdk,或使用 pnpm add / yarn add / bun add。

@boulevard/blvd-book-sdk 支持 TypeScript 吗?

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

@boulevard/blvd-book-sdk 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@boulevard/blvd-book-sdk 可以商用吗?

@boulevard/blvd-book-sdk 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@boulevard/blvd-book-sdk 的下载量有多少?

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

@boulevard/blvd-book-sdk 还在维护吗?

最新版本 2.0.10 发布于 2025/09/24(1.1 年前);至今共发布 62 个版本,其中过去 12 个月发布了 0 个;首次发布于 2021/06/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。