npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@boulevard/blvd-book-sdk

v2.0.2

Published

A JS client for the Boulevard API

Downloads

243

Readme

TypeScript GitHub license GitHub release PRs Welcome

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: 2025,
    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.