Smalt Création Manager API Connector
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
manager-api.js
package.js

README.md

Example

import { Client } from 'meteor/smaltcreation:manager-api';

const client = new Client({
    protocol: 'http', // optional, default: 'https' 
    serverIp: 'localhost',
    serverPort: 3000, // optional, default: 80
    serviceName: 'MyService',
    servicePassword: 'my-password'
});

// Log in
client.logIn(error => {
    if (error) {
        // Handle error
        console.log('error on log in', error);
    } else {
        // Logged in, add point to chart #1 (y = 300)
        client.addChartPoint(1, 300, error => {
            if (error) {
                // Handle error
                console.log('error on add chart point', error);

                // Point added, log out
                client.logOut(error => {
                    if (error) {
                        // Handle error
                        console.log('error on log out', error);
                    }
                });
            }
        });
    }
});