JavaScript Client

Source code: https://github.com/tryterra/terra-client-js

class Terra

An object that manages getting data, verifying signatures and authenticating users

Initialisation

const { default: Terra } = require("terra-api");

const terra = new Terra(devId: string, apiKey: string, secret: string);

Methods

Method NameReturnsExplanation
getActivityPromisereturns an api response that when parsed contains activity data
getAthletePromisereturns an api response that when parsed contains athlete data
getBodyPromisereturns an api response that when parsed contains body data
getDailyPromisereturns an api response that when parsed contains daily data
getMenstruationPromisereturns an api response that when parsed contains menstruation data
getNutritionPromisereturns an api response that when parsed contains nutrition data
getSleepPromisereturns an api response that when parsed contains sleep data
getProvidersPromisereturns an api response that when parsed contains one list for web providers and another for sdk providers
getUsersPromisereturns an api response that when parsed contains a list of all users
checkTerraSignatureBoolreturns whether the body was sent from Terra
deauthUserPromisereturns an api response object that when parsed returns a
generateWidgetSessionPromisereturns an api response that when parsed contains details about an authentication session with one of the inputted providers
getUsersPromisereturns an api response that when parsed contains user data