https://github.com/vaaski/openmagicline
The Magicline API for everybody.
https://github.com/vaaski/openmagicline
Last synced: 3 months ago
JSON representation
The Magicline API for everybody.
- Host: GitHub
- URL: https://github.com/vaaski/openmagicline
- Owner: vaaski
- License: mit
- Created: 2021-06-05T09:37:17.000Z (about 5 years ago)
- Default Branch: v2
- Last Pushed: 2025-04-13T12:42:22.000Z (about 1 year ago)
- Last Synced: 2025-04-13T13:29:54.273Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 665 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
Openmagicline
The Magicline API for everybody.
## Synopsis
I work at a gym that has been using [magicline](https://magicline.com) for
well over a decade now.
When they switched to a completely new cloud-based web-interface in about 2016,
using magicline got a lot slower. The new interface not only took a
significant time to get used to, it also runs considerably slower than
the previous (native) one. This sucks for an environment where the
customer expects fast and reliable service.
I build custom software to speed up the workflow, and Openmagicline is the
adapter that powers it.
Openmagicline is a **reverse-engineered**, **strongly-typed** version of
magicline's internal API.
## Usage
This is far from feature-complete as I only implement the parts I need.
Feel free to use it, but expect a lot of functionality to be missing.
I am, however, very open to [contributions](#roadmap) and this project should be a
solid starting point for anyone who wants to implement missing functionality.
```ts
const magicline = new Openmagicline({
gym: "gym", // example for https://gym.web.magicline.com
username: "your username",
password: "your password",
})
await magicline.login()
await magicline.customer.search("John Doe")
```
## Features
- **Strongly-typed** - All API calls and responses are typed
- **Authentication** - Automatically re-authenticates on session expiry
- **Covered** - Probably close to 100% test coverage
## Roadmap
- Detect magicline version and warn if openmagicline is outdated
- Improve tests and verify API responses with something like zod
## New in v2
- Added setting `organizationUnitId` per instance to avoid re-checking it.
- This is optional, it'll get the default unitID if not provided.
- Added checkoutByCustomerID to Checkin class which utilizes a cached map of
customerID -> checkinID to avoid having to re-list checkins.
- Switched to [Bun](https://bun.sh) for package management and testing.
- Switched to [ofetch](https://npmr.vaa.ski/ofetch) for HTTP requests.
- Switched to [Biome](https://biomejs.dev) for linting and formatting.