Skip to content

Latest commit

 

History

History
103 lines (80 loc) · 1.95 KB

README.md

File metadata and controls

103 lines (80 loc) · 1.95 KB

Swingbot Pro SDK

This is the client for interacting with the Swingbot Pro API. This is for subscribers to the Swingbot Pro Platform.

Installation

npm install swingbot-pro-sdk

or

yarn add swingbot-pro-sdk

Methods

init

Initialize the client object

const SwingbotProSDK = require('swingbot-pro-sdk');
const client = SwingbotProSDK.init(API_KEY);

login

Login a user.

const SwingbotProSDK = require('swingbot-pro-sdk');
const client = SwingbotProSDK.init(API_KEY);
client.login(email, password)
    .then(results => {
        // do something
    }).catch(e => {
        // handle error
    });

uploadVideo

Upload a video to Swingbot Pro for processing. Include the file to upload, the email of the user this file belongs to, and the id of the lesson program from the dashboard.

const SwingbotProSDK = require('swingbot-pro-sdk');
const client = SwingbotProSDK.init(API_KEY);

client.uploadVideo(file, email, lessonProgramId)
    .then(uploadResults => {
        // do stuff here!
    })
    .catch(e => {
        // handle the error
    });

getAnalysisById

const SwingbotProSDK = require('swingbot-pro-sdk');
const client = SwingbotProSDK.init(API_KEY);

client.getAnalysisById(analysisId)
    .then(analysisResults => {
        // do stuff here!
    })
    .catch(e => {
        // handle the error
    });

getVideosByUserId

const SwingbotProSDK = require('swingbot-pro-sdk');
const client = SwingbotProSDK.init(API_KEY);

client.getVideosByUserId(userId)
    .then(videos => {
        // do stuff here!
    })
    .catch(e => {
        // handle the error
    });

getWebsiteConfig

const SwingbotProSDK = require('swingbot-pro-sdk');
const client = SwingbotProSDK.init(API_KEY);

client.getWebsiteConfig()
    .then(websiteConfig => {
        // do stuff here!
    })
    .catch(e => {
        // handle the error
    });