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 🙏

© 2026 – Pkg Stats / Ryan Hefner

reservekitjs

v1.1.0

Published

ReserveKit JS SDK

Readme

ReserveKit JS SDK

A JavaScript/TypeScript library for interacting with the ReserveKit API. This SDK provides a simple interface for managing services, time slots, and bookings.

Installation

Install the package using npm:

npm install reservekitjs

Or using yarn:

yarn add reservekitjs

Or using pnpm:

pnpm add reservekitjs

Quick Start

import { ReserveKit } from 'reservekitjs'

// Initialize the client with your API key and service ID
const client = await ReserveKit.create('your_api_key', 1)

// Access service properties
console.log(client.service.name)
console.log(client.service.description)

// Get available time slots
const timeSlots = await client.service.getTimeSlots()

// Create a booking
const booking = await client.service.createBooking({
  customer_name: 'John Doe',
  customer_email: '[email protected]',
  customer_phone: '+1234567890',
  date: '2024-01-01',
  time_slot_id: 1
})

API Reference

ReserveKit Class

Static Factory Method

static create(secretKey: string, serviceId: number, options?: ReserveKitOptions): Promise<ReserveKit>

Parameters:

  • secretKey (required): Your ReserveKit API key. Do not expose this key in client-side code.
  • serviceId (required): The ID of the service to initialize
  • options (optional): Configuration options
    • host: API host (default: 'https://api.reservekit.io')
    • version: API version (default: 'v1')

Returns: A Promise that resolves to an initialized ReserveKit instance.

Constructor (Alternative Method)

new ReserveKit(secretKey: string, options?: ReserveKitOptions)

Note: When using the constructor directly, you'll need to call initService(serviceId) separately. It's recommended to use the static create() method instead for a better developer experience.

Methods

initService(serviceId: number)

Initializes a service by its ID. Returns a Promise that resolves when the service is loaded.

Service Client

Once a service is initialized, you can access its properties and methods through reserveKitClient.service:

Properties

  • id: Service ID
  • name: Service name
  • description: Service description
  • provider_id: Provider ID
  • version: Service version
  • created_at: Creation date
  • updated_at: Last update date

Methods

getTimeSlots()

Returns a Promise that resolves to an array of available time slots for the service.

createBooking(payload)

Creates a new booking for the service.

Parameters:

interface CreateBookingPayload {
  customer_name?: string;
  customer_email?: string;
  customer_phone?: string;
  date: string | Date;
  time_slot_id: number;
}

Error Handling

The SDK uses a consistent error handling pattern. All methods that make API requests can throw errors. It's recommended to wrap calls in try-catch blocks:

try {
  await reserveKitClient.initService(1)
} catch (error) {
  console.error('Failed to initialize service:', error.message)
}

TypeScript Support

This SDK is written in TypeScript and includes type definitions. You'll get full type support when using TypeScript in your project.

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For support, please open an issue in the GitHub repository.