ABSmartly.HTTP.Client (ABSmartly v1.0.0)

Copy Markdown View Source

HTTP client for ABSmartly API with retry logic.

Summary

Functions

The value sent as the X-Agent header: "absmartly-elixir-sdk/<version>".

Functions

agent()

The value sent as the X-Agent header: "absmartly-elixir-sdk/<version>".

fetch_context(endpoint, api_key, application, environment, retries \\ 3, timeout \\ 30000)

Fetch context data from API endpoint.

Implements retry logic:

  • Retry on network errors and 5xx status codes
  • Don't retry on 4xx status codes
  • Exponential backoff: 50ms × 2^attempt

publish_events(endpoint, api_key, application, environment, events, retries \\ 3, timeout \\ 30000)

Publish events to API endpoint.