2.414.3 • Published 1 month ago

@stigg/sidecar v2.414.3

Weekly downloads
-
License
LicenseRef-LICENS...
Repository
-
Last release
1 month ago

Stigg Sidecar Service

What does Stigg Sidecar do?

Stigg Sidecar is a tiny service that runs alongside the main application, acting as a proxy between the host and the Stigg API, while ensuring low latency entitlement checks, handles caching and provides simplified access to real-time data.

The benefits of deploying the Sidecar:

  • Less CPU consumption and memory footprint for the host application when compared to embedding the SDK directly
  • Language neutral API via Protocol Buffers and gRPC
  • Support for in-memory cache or external cache (Redis) for entitlements and usage data
  • Scaled together with the main application, or independently if deployed as a standalone service
  • Synergy with persistent-cache-service if external cache is in use
  • Easy generation of SDK clients in multiple languages, backed by well-known RPC frameworks and tools

Architecture

Architecture

Prerequisites:

  • Docker
  • Redis instance, if redis cache is used

Usage:

Login to AWS ECR:

aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/stigg

Run the service:

docker run  --rm --name stigg-sidecar --memory=1gb --cpus="1" \
  --publish=8443:8443 --publish=8080:8080 \
  -e SERVER_API_KEY="<SERVER_API_KEY>" \
  public.ecr.aws/stigg/sidecar:latest

Configuration:

Environment VariableTypeDefaultDescription
SERVER_API_KEYString*Environment server API key
API_URLStringhttps://api.stigg.ioStigg API address URL
EDGE_ENABLEDBoolean1Edge API enabled
EDGE_API_URLStringhttps://edge.api.stigg.ioEdge API URL
WS_ENABLEDBoolean1Websocket enabled
WS_URLStringwss://api.stigg.ioWebsocket API URL
REDIS_ENVIRONMENT_PREFIXStringIdentifier of the environment. If provided, Redis cache will be used.
REDIS_HOSTStringlocalhostRedis host address
REDIS_PORTNumber6379Port of your redis
REDIS_DBNumber0DB identifier to use when writing to Redis
REDIS_USERNAMEStringRedis username
REDIS_PASSWORDStringRedis password
REDIS_KEYS_TTL_IN_SECSNumber7 * 24 * 60 * 60Time for entitlements to be cached,in milliseconds
PORTNumber8443gRPC/Connect server port (HTTPS)
METRICS_PORTNumber8080Metrics and health endpoints port (HTTP)
ENTITLEMENTS_FALLBACKString | Fallback entitlements in a JSON string format.
HEALTH_ENDPOINT_URLStringlivezHealth endpoint URL
READY_ENDPOINT_URLStringreadyzReady endpoint URL
OFFLINEBooleanEnable offline mode for local development

*Required fields

Health and Metrics:

The service exposes health and metrics endpoints on HTTP server (default port 8080).

GET /livez

Returns 200 if the service is alive.

Healthy response: {"status":"UP"}

GET /readyz

Returns 200 if the service is ready.

Healthy response: { "status": "UP" }

GET /metrics

Returns Prometheus metrics in text format.

2.412.2

2 months ago

2.414.3

1 month ago

2.335.0

3 months ago

2.333.0

3 months ago

2.337.0

3 months ago

2.413.0

2 months ago

2.381.0

2 months ago

2.329.2

4 months ago

2.401.3

2 months ago

2.401.4

2 months ago

2.401.1

2 months ago

2.330.0

4 months ago

2.294.3

6 months ago

2.294.1

6 months ago

2.294.2

6 months ago

2.320.0

4 months ago

2.295.1

6 months ago

2.186.0

8 months ago

2.290.0

6 months ago

2.236.1

7 months ago

2.292.2

6 months ago

2.290.1

6 months ago

2.171.0

9 months ago

2.170.0

9 months ago

2.164.0

9 months ago

2.156.0

9 months ago

2.153.0

9 months ago

1.237.0

1 year ago

2.48.0

12 months ago

2.95.0

11 months ago

2.0.0

1 year ago

2.112.1

10 months ago

2.112.0

10 months ago

2.78.2

11 months ago

1.227.0

1 year ago

2.36.0

12 months ago

2.85.0

11 months ago

2.87.1

11 months ago

2.85.2

11 months ago

2.103.0

10 months ago

2.81.0

11 months ago

2.108.0

10 months ago

1.160.1

1 year ago

1.98.3

1 year ago

1.58.3

1 year ago

1.49.0

1 year ago

1.40.8

1 year ago

1.40.7

1 year ago

0.721.1

2 years ago

0.719.0

2 years ago

0.705.0

2 years ago

0.697.4

2 years ago

0.697.3

2 years ago

0.697.2

2 years ago

0.697.1

2 years ago

0.697.0

2 years ago

0.689.0

2 years ago

0.687.3

2 years ago

0.687.2

2 years ago