Configuring Services
Some of the NetsBlox services, such as GoogleMaps, require a default API key to be provided on the deployment to be available. Requests to these services will then use the default API key if the user does not have any API keys defined for him/herself or for the group/class.
If you don’t mind viewing the source code, the keys (and links to set up an API key) can be found here.
All API keys can be set by setting the corresponding environment variable.
The environment variable is either generated automatically by converting the name to all caps and replacing spaces with underscores (eg, Google Maps -> GOOGLE_MAPS_KEY
) or is is listed in the referenced code snippet as the third value passed to ApiKey
.
For example, The Movie Database
is set using TMDB_API_KEY
.
Required Environment Variables for Services
Service |
Environment Variable |
Provider |
---|---|---|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Services Requiring Additional Configuration
Alexa Service
There are a few steps to enable the Alexa service on a custom NetsBlox deployment. They are outlined here:
Register “Amazon Alexa” as an OAuth client using the NetsBlox CLI
Generate LWA Keys (instructions here)
Set the environment variables using the values from the above steps:
Set the client ID and secret from the first step as OAUTH_CLIENT_ID and OAUTH_CLIENT_SECRET
Set the client ID and secret from the second step as LWA_CLIENT_ID and LWA_CLIENT_SECRET
Confirm that the standard configuration environment variables are correctly set including:
NETSBLOX_CLOUD should be set to the publicly accessible URL for the NetsBlox cloud
NETSBLOX_CLOUD_ID should be set to the ID used when registering the services server with the NetsBlox cloud
NETSBLOX_CLOUD_SECRET should be set to the secret returned when registering the services server with the NetsBlox cloud
SERVER_URL should be set to the publicly accessible URL for the services server such as http://services.netsblox.org