Vital Link

Vital Link is a client-side component your users will use to link their accounts with Vital and allow you to access their accounts via the Vital API.

Vital Link will handle credential validation and multi-factor authentication. Links works across modern browsers and mobile browsers via webviews.

Custom UI

We also support authenticating without Vital link. This is useful for users who don't want to use Vital link but still want to use the Vital API.
To authenticate without Vital link, you need to first generate alink_token for a specific user.
Generate Link Token
1
2
3
4
5
6
7
8
9
from vital import Client

client = Client(
     client_id, 
     client_secret, 
     environment="sandbox"
     )
 
token = client.Link.create(user_key)
Once you have your Vital link token, you can use this to connect to a specific provider. Providers are split into three buckets Email, OAuth, Password Providers.

To Connect an Email Provider

Current email providers are
Freestyle
Abbott CGM Glucose monitor
Connect Email provider
1
2
3
4
5
6
7
8
9
10
from vital import Client

client = Client(
     client_id, 
     client_secret, 
     environment="sandbox"
     )
 
token = client.Link.create(user_key)
resp = client.Link.email_provider(link_token, "freestyle_libre", email)

To Connect an Password Provider

Current password providers are
Whoop
Personalised Fitness Tracker
Renpho
Fitness Scales
Zwift
Virtual cycling and running
Peloton
Popular Indoor Exercise bike
Connect Password provider
1
2
3
4
5
6
7
8
9
10
from vital import Client

client = Client(
     client_id, 
     client_secret, 
     environment="sandbox"
     )
 
token = client.Link.create(user_key)
resp = client.Link.password_provider(link_token, "whoop", username, password)

To Connect an OAuth Provider

Current OAuth providers are
Fitbit
Activity Trackers (all devices)
Garmin
Fitness watches (all devices)
Oura
Smart Sleep tracking ring
Strava
Running & Cycling Social Network
Wahoo
Cycling Equipment
Connect OAuth provider
1
2
3
4
5
6
7
8
9
10
11
from vital import Client

client = Client(
     client_id, 
     client_secret, 
     environment="sandbox"
     )
 
token = client.Link.create(user_key)
oauth_url = client.Link.oauth_provider(link_token, "fitbit")
# redirect user to returned oauth_url
For OAuth Providers we return a oauth_url, that you can use to redirect users to in a webview. In a web browser on success the window would close and you are expected to check the connected providers on refocus to determine if the user has connected. In the case of mobile, the user receives a message to head back to the app. Our recommended way for mobile is to launch Link, as specified in the previous section, in a spefic state so you can receive the appropriate success messages in app.
The possible error codes that are returned are as follows:
401 INVALID_REQUEST Link Token is Invalid
400 MISSING_LINK_TOKEN Missing link token
400 INVALID_PROVIDER Provider is not supported
400 INVALID_USER_KEY User key is incorrect
400 INVALID_CREDENTIALS Credentials for provider are incorrect