RPC Support

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 RPCs

Service Environment Variable Provider
AirQuality AIR_NOW_KEY Air Now
Geolocation GOOGLE_MAPS_KEY Google Maps
GoogleMaps GOOGLE_MAPS_KEY Google Maps
GoogleStreetView GOOGLE_MAPS_KEY Google Maps
MovieDB TMDB_API_KEY The Movie Database
NewYorkPublicLibrary NEW_YORK_PUBLIC_LIBRARY_KEY New York Public Library
NewYorkTimes NEW_YORK_TIMES_KEY New York Times
ParallelDots PARALLELDOTS_KEY ParallelDots
Pixabay PIXABAY Pixabay
Smithsonian DATA_GOV_KEY Data.gov
Traffic BING_TRAFFIC_KEY Bing Maps
Translation AZURE_TRANSLATION_KEY Azure Translation
Weather OPEN_WEATHER_MAP_KEY Open Weather Map

To simplify this process (and to keep your ~/.bashrc clean), these values can be stored in a .env file in the project root directory and they will be loaded into the environment on starting NetsBlox.