2.0.3 • Published 3 years ago

gymhappy-client v2.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Gym Happy API client

Interface with your Gym Happy account, without the hassle.

This package is intended to perform basic API functions within Gym Happy, without having to worry about manually providing request cache data/encoding request integrity. This module exposes simple JS/TS functions which can be used to imperatively make requests directly to Gym Happy.


Usage

import gymHappy from 'gymhappy-client';

const gym = gymHappy('==API KEY==', '==CLIENT UID==');

// Register event for customer
gym.register(
    '==CUSTOMER ID==',

    // Register that `checkins`=24 for this customer
    'checkins',
    24,

    // Set the metadata that apply to this given checkin
    [
        ['coach', 'John'],
        ['time', 6],
    ]
);

// Set a customer's user data
gym.setCustomer(
    '==CUSTOMER ID==',

    // User data - createdAt and updatedAt are automatically set
    // and are ignored if passed here.
    {
        firstName: 'John',
        surname: 'Smith',
        customerMetadata: 4.2,

        // ignored property - is immutable/reserved
        belongsTo: '==CLIENT ID==',
    }
)
2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago