1.4.5 • Published 5 months ago

terra-api v1.4.5

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Terra Javascript Package

A wrapper in javascript for the Terra endpoints and models.

Full API reference: https://tryterra.github.io/terra-client-js

Check the example server with a webhook in /example!

Usage

Install using

npm i terra-api

Then import the default Terra package from terra-api.

Initialise a new Terra instance with:

const terra = new Terra(process.env.DEV_ID, process.env.API_KEY);

Now you can call the following functions from the instance, for example:

  • generateWidgetSession
  • getProviders
  • getUsers
  • getUser
  • deauthUser
  • getAthlete
  • getActivity
  • getBody
  • getDaily
  • getSleep
  • getMenstruation

Check the full reference on https://tryterra.github.io/terra-client-js/

In addition, all the data models documented on https://docs.tryterra.co/data-models are available to import and use. For example

const terra = new Terra(process.env.DEV_ID, process.env.API_KEY);
terra
  .getAthlete("1234-user-id-5678", false)
  .then((res) => console.log(res.athlete.first_name))
  .catch((e) => console.log(e.status, e.message));

The models support autocompleting the types to manipulate data coming from Terra, which should accelerate your backend development:

typed_1

1.4.5

5 months ago

1.4.4

5 months ago

1.4.2

7 months ago

1.4.1

7 months ago

1.3.3

12 months ago

1.4.0

10 months ago

1.3.2

1 year ago

1.3.1

1 year ago

1.2.0

1 year ago

1.1.9

1 year ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.2.2

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago