Mind Body API - Node.js Client
I couldn't find a client implemented in Node for the Mind Body API beyond this long-forgotten PR, so I took that PR and used it as the basis for creating what you now see before you.
As you can see, the codebase currently only handles a couple of endpoints, (the ones that I used in my project) and has only two tests written (which are designed to serve more as examples than anything else).
Additionally, everything is currently in one file; I imagine that if we added more endpoints that we'd need to modularize things a bit to avoid a bit of a mess, but that wouldn't be hard at all should the need arise.
Feel free to contribute!
Supported Endpoints
Client Service
- AddOrUpdateClients
- GetClients
Site Service
- GetActivationCode
Installation
npm install --save mindbody-node-client
Standard Usage (Env. Variables)
const MindBodyAPI = ;const mindBodyAPI = ; mindBodyAPI;
By default, the library will use the environment variables listed further down on this page.
However, you can also explicitly pass in your credentials when you're creating an instance of the module. These will always overwrite your env. variables (if present).
Explicit Usage (Config. Object)
const MindBodyAPI = ;const mindBodyAPI = sourceName: 'foo' sourcePassword: 'bar' siteID: '-99' username: 'foo' password: 'bar'; mindBodyAPI;
Environment Variables
- SourceCredentials
- Name: MB_SOURCE_NAME
- Password: MB_SOURCE_PASSWORD
- UserCredentials
- Username: MB_USERNAME
- Password: MB_PASSWORD