Setting Up Docker Container

To set the Docker container for the API Proxy, you need to provide it with a few environment variables. We highly recommend keeping these variables outside of your version control system.

EXAMPLE DOCKER-COMPOSE.YAML
services:
  gerosense:
    image: gerosense/api-proxy:1.3.0
    env_file: .env

Below, is the list of supported environment variables:

Name
Description

GEROSENSE_API_HOST*

The API host assigned to your account

GEROSENSE_API_ACCOUNT*

Your account name

GEROSENSE_API_ACCOUNT_PASSWORD*

Your account password

JWT_SECRET*

Configuration for the JWT secret used to authenticate your users. See below for details

HOST

The host on which api-proxy will listen. The default is 0.0.0.0

PORT

The port on which api-proxy will listen. The default is 8000

JWT_SECRET Configuration

JWT_SECRET is an JSON object with the following fields:

Field
Description

type

The type of your JWT secret. Don't specify it if you use jwk_url. For Firebase, don't specify it. For Supabase, it's HS256. Supported algorithms: HS256, HS384, HS512, ES256, ES384, RS256, RS384, RS512, PS256, PS384, PS512, EdDSA.

key

Your JWT secret key. Don't specify it if you use jwk_url. For Firebase, don't specify it. For Supabase, you can find it under Settings > API > JWT Secret. For other providers: In the case of a symmetric key (i.e., an HMAC-based key), just the key as is. The key must be long enough for the chosen algorithm (e.g., for HS256, it must be at least 32 characters long).

In the case of an asymmetric key (RSA, EdDSA, ECDSA, etc.), only the public key is in a PEM-encoded string or as an X509 certificate.

jwk_url

JSON Web Key URL. For Firebase, use: https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com For Supabse, don't specify it.

audience

One or multiple supported audiences. For Firebase, use your project ID. For Supabase, by default, authenticated users have authenticated audience. Use an array in case you need to support multiple audiences: ["audience1", "audience2", ...]

issuer*

Issuer of the token. For Firebase, use: https://securetoken.google.com/<firebase-project-id> For Supabase, use: https://<project-id>.supabase.co/auth/v1

EXAMPLE .ENV FOR FIREBASE
GEROSENSE_API_HOST=https://api-b2b.gerosense.ai
GEROSENSE_API_ACCOUNT=<your-account-name>
GEROSENSE_API_ACCOUNT_PASSWORD=<your-account-password>

JWT_SECRET='{"jwk_url":"https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com","audience":"<firebase-project-id>","issuer":"https://securetoken.google.com/<firebase-project-id>"}'
EXAMPLE .ENV FOR SUPABASE
GEROSENSE_API_HOST=https://api-b2b.gerosense.ai
GEROSENSE_API_ACCOUNT=<your-account-name>
GEROSENSE_API_ACCOUNT_PASSWORD=<your-account-password>

JWT_SECRET='{"type":"HS256","key":"<jwt-secret-from-supabase>","audience":"authenticated","issuer":"https://<project-id>.supabase.co/auth/v1"}'

Last updated