Type safe library for interacting with Mindbody's Public API (v6) and Webhooks

Overview

Mindbody API

Type safe library for interacting with Mindbody's Public API (v6) and Webhooks

Latest version of splitpass/mindbody-api is 0.1.6

⚠️ Read before installing
This library is typed according to the definitions available in Minbody's API docs. Their API fails to establish consistent patterns and field type definitons. An ID may be typed as a string or number and commonly swaps to a different type depending on the endpoint. Schema definitions are sometimes incomplete or completely wrong. Schema fields and endpoint paramters are only sometimes marked as nullable / optional. Please keep all this in mind when using this library. SplitPass uses this library internally (heavily) and we will correct / expand type definitions as we run accross issues. BUT, we do not interact with 100% of Mindbody's API. Please submit an issue or PR if you find an issue or would like to expand a type definition (ex. make a field nullable or query param / payload param optional)

The package includes all endpoints added before or during the September 2022 release.

PRs are welcome if we are behind the release schedule and you would like to use a new endpoint that was added

https://developers.mindbodyonline.com/Resources/ApiReleaseNotes

Requirements

Node 12.4 or higher.

Installation

Install the package with:

npm install mindbody-api-v6 --save
# or
yarn add mindbody-api-v6

Usage

Mindbody requires an API key to interact with endpoints and may additionally require a token generated from your staff credentials. Actions such as adding clients to a class require a user token included in the request headers. Tokens may only be generated for locations that have explicitly granted you permission. Some endpoints may limit the data returned if no token is provided.

https://developers.mindbodyonline.com/

import { Config } from 'mindbody-api-v6';

Config.setup({
  apiKey: '',
});
// or
Config.setup({
  apiKey: '',
  username: '',
  password: '',
});

Example

Endpoints are logically separated based on the categories listed here.

import { Class, Client, Staff } from 'mindbody-api-v6';

const classes = await Class.getClassSchedules({
  siteID: '123',
  params: {
    StartDate: '2022-01-01',
    LocationIds: [1, 2],
  },
});

const newClient = await Client.addClient({
  siteID: '123',
  payload: { ... }
})

/**
 * Endpoints with optional parameters
 * or payloads may exclude the field
 */
const staff = await Staff.getStaff({
  siteID: '123',
});

Types

All model definitions are exported under MBType. A full list of models can be found here. Additional models were added for easy access to complex types not listed in Mindbody's documentation

import { MBType } from 'mindbody-api-v6';

const staff: MBType.Staff = ...;
const client: MBType.Client = ...;

Roadmap

Version Features
0.2.0 Auto pagination, webhooks
1.0.0 Test coverage, type refinement
You might also like...

Integrate Railway Project events with Telegram Chat/Channel using Railway Webhooks

Railway to Telegram Integrate Railway Project events with Telegram Chat/Channel using Railway Webhooks! One Click Self Deploy Manual Self Deploy Fork

Jul 5, 2022

An application for sending webhooks on Discord.

An application for sending webhooks on Discord.

Cordhook 🪝 Cordhook is an application for sending webhooks on Discord with ease. 🛠 Built with Tauri for desktop and Next.js for web. 🎨 Styled with

Jan 4, 2023

Slack Integration to receive incoming webhooks from openpix.com.br

Slack Integration to receive incoming webhooks from openpix.com.br

Slack Integration This is a aws lambda function to receive new transaction informations from OpenPix @ your company's slack workspace. Getting Started

Sep 19, 2022

medusa-plugin-webhooks

medusa-plugin-webhooks

Medusa Plugin Webhooks About Participants Anish De GitHub: @AnishDe12020 Twitter: @AnishDe12020 Discord: AnishDe12020#8442 (ID: 727047127271735387) De

Dec 18, 2022

A zero-dependency, buildless, terse, and type-safe way to write HTML in JavaScript.

hdot A sensible way to write HTML in JavaScript. Type-safe. Helps you follow the HTML spec. Terse. Almost character for character with plain HTML. Bui

Oct 24, 2022

Cloudy is a set of constructs for the AWS Cloud Development Kit that aim to improve the DX by providing a faster and type-safe code environment.

cloudy-ts These packages aren't yet published on npm. This is still highly experimental. Need to figure out a few things before releasing the first ve

Nov 3, 2022

A script that combines a folder of SVG files into a single sprites file and generates type definitions for safe usage.

remix-sprites-example A script that combines a folder of .svg files into a single sprites.svg file and type definitions for safe usage. Technical Over

Nov 9, 2022

A fully type-safe and lightweight way of using exceptions instead of throwing errors

🛡️ exceptionally A fully type-safe and lightweight way of using exceptions instead of throwing errors 🦺 fully typesafe 🐤 lightweight (209 bytes) 🏃

Jan 4, 2023

Build type-safe web apps with PureScript.

Build type-safe web apps with PureScript.

PUX Build type-safe web applications with PureScript. Documentation | Examples | Chat Pux is a PureScript library for building web applications. Inter

Jun 18, 2022
Releases(v0.2.1)
Owner
SplitPass
Don't pay for things you don't use
SplitPass
100% type-safe query builder for node-postgres :: Generated types, call any function, tree-shakable, implicit type casts, and more

⚠️ This library is currently in alpha. Contributors wanted! tusken Postgres client from a galaxy far, far away. your database is the source-of-truth f

alloc 54 Dec 29, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Generate social preview images in your Next.js API from Sanity webhooks

sanity-next-social-image-generator Automatically generate social share images using Sanity webhooks, and your Next.js API! Requirements A Next.js appl

Jordan McRae 9 Sep 4, 2022
A fully type-safe and lightweight internationalization library for all your TypeScript and JavaScript projects.

?? typesafe-i18n A fully type-safe and lightweight internationalization library for all your TypeScript and JavaScript projects. Advantages ?? lightwe

Hofer Ivan 1.3k Jan 4, 2023
A functional, immutable, type safe and simple dependency injection library inspired by angular.

func-di English | 简体中文 A functional, immutable, type safe and simple dependency injection library inspired by Angular. Why func-di Installation Usage

null 24 Dec 11, 2022
JavaScript API based capstone project using TVmaze API for displaying and interacting with items from the data base.

Yuriy Chamkoriyski & Bonke Gcobo Javascript capstone project API-based webapp from Module 2 at Microverse Wireframe requirements The Home Page low fid

Yuriy Chamkoriyski 5 May 30, 2022
📡Usagi-http-interaction: A library for interacting with Http Interaction API

?? - A library for interacting with Http Interaction API (API for receiving interactions.)

Rabbit House Corp 3 Oct 24, 2022
Compact library for interacting with Ankr Scan Multichain API.

ankrscan.js Compact SDK for interacting with Ankr Scan MultiChain JSON-RPC API. SDK supports following MultiChain methods: getLogs - logs matching the

Ankr 23 Jan 3, 2023