App guidelines

General guidelines for writing applications and libraries for Pryv.io platforms.

Web applications should be implemented to be platform agnostic, so they can be run on your production environment as well as your staging one.
Our example applications can be run on our Pryv Lab platform as well as your own.

Auto-configuration

Applications should retrieve configuration parameters from the service information.

For this we suggest to implement the following ways to load its configuration:

  1. pryvApiEndpoint query param

An URL in the Basic HTTP Authorization form.

Example:https://cdtasdjhashdsa@testuser.pryv.me as API endpoint (URL encoded)

https://sample.domain/app/index.html?pryvApiEndpoint=https%3A%2F%2Fcdtasdjhashdsa%40testuser.pryv.me

Note: service information should be retrieved by appending the path /service/info to the value given by pryvApiEndpoint.

  1. pryvServiceInfoUrl query param

Example: https://reg.pryv.me/service/info as service information URL (URL encoded)

https://sample.domain/app/index.html?pryvServiceInfoUrl=https%3A%2F%2Freg.pryv.me%2Fservice%2Finfo

Prevalence

If multiple parameters are provided, the following order of priority should be used:

  1. pryvServiceInfoUrl as query parameter
  2. pryvApiEndpoint as query parameter
  3. pryvServiceInfoUrl as default value

Authorization

Using a pryvApiEndpoint to load an app allows to load data directly as it usually contains credentials. For cases where you require authentication, it is preferred to use pryvServiceInfoUrl: