Configuration

Definition#

A configuration is a set of json config for OAuth, Tracker, Payment, Hestia and other Teko services...
One App can have many versions, each Version can have some Environment, and each environment have an according configuration.

The configuration is setup from Terra Console and then downloaded to client by Terra library.

Example of an app configuration#

{
"@type": "type.googleapis.com/terra.v1.Pandora",
"config": {
"data": {
"@type": "type.googleapis.com/terra.v1.AppConfigData"
},
"extra": {
"ENABLED_LOYALTY": "true",
"HOTLINE": "1800 5888 59",
"POLICY": "https://vnshop.vn/term-and-policies-app"
}
},
"services": [
{
"name": "Firebase",
"code": "firebase",
"config": {
"data": {
"@type": "type.googleapis.com/terra.v1.FirebaseServiceConfigData",
"projectId": "aaa",
"applicationId": "bbb",
"apiKey": "ccc",
"databaseUrl": "ddd",
"storageBucket": "eee",
"gcmSenderId": "fff"
}
}
},
{
"name": "Tracker",
"code": "tracker",
"config": {
"data": {
"@type": "type.googleapis.com/terra.v1.TrackerServiceConfigData",
"url": "https://footprint-ingestor.tekoapis.com/",
"clientId": "ggg"
}
}
}
// other services configuration here...
]
}

Create initial file#

Terra will manage configuration of your app automatically, the only thing it will need is a initial file placed inside your project.

You can create this file following one of below method:

Manually#

Create a file named TerraService-<product_code>.json in app assets folder with below data

{
"terraClientID": "vnshop:android:playstore:1.0.0",
"terraEnvironment": "live"
}
  • ProductCode is your product code, for detail please refer here
  • TerraClientID is your app client id, for detail please refer here
  • TerraEnvironment is Terra Environment, please set as live

Download from Terra Console#

  1. At Terra Console homepage, click your product to enter its detail page

  1. At product page, select Applications on the left menu, then click your app to open it detail page. The list of version will be shown below.

  1. Click the version you want to download the config, then click Download Config button and save the file to assets folder for android / project folder for iOS