Skip to content

feat: default analytics to the dedicated ingest service - #25

Merged
tomasstark merged 2 commits into
mainfrom
feat/analytics-ingest-default
Jul 16, 2026
Merged

feat: default analytics to the dedicated ingest service#25
tomasstark merged 2 commits into
mainfrom
feat/analytics-ingest-default

Conversation

@tomasstark

Copy link
Copy Markdown
Contributor

This PR points the SDK's analytics relay at the dedicated ingest service (https://ingest-connect.supertab.co) by default, instead of the API host. Only the analytics host changes — the /ingest/events path and payload are the same, and token acquisition / JWKS / verification still use the API base URL.

Context

Ports the TypeScript SDK 2.2.2 change (phase 2 of splitting analytics ingest onto its own service): any handler running analyticsEnabled: true shifts its ingest traffic onto the standalone service on upgrade, draining ingest load off the main API.

Key Changes

  • New static $analyticsBaseUrl defaulting to the ingest service, wired into the default HttpAnalyticsTransport in place of the API base URL.
  • New analyticsBaseUrl constructor option plus static setAnalyticsBaseUrl() / getAnalyticsBaseUrl(), mirroring baseUrl / setBaseUrl(). Precedence matches TS: per-instance option > static setter > ingest default; the per-instance option does not mutate the global.
  • Test suite mirroring the TS analytics base URL resolution cases: default host, both overrides, precedence, and independence from setBaseUrl().
  • README: analytics section and config table describe the new host and options.

Ref: connect-sdk-typescript#41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the PHP SDK’s analytics relay configuration so analytics events default to the dedicated ingest service (https://ingest-connect.supertab.co) rather than the API host, while keeping token acquisition/JWKS/verification on the API base URL.

Changes:

  • Add a separate static SupertabConnect::$analyticsBaseUrl defaulting to the ingest service, plus setAnalyticsBaseUrl() / getAnalyticsBaseUrl().
  • Add a per-instance analyticsBaseUrl constructor option that overrides the static value without mutating global configuration.
  • Add tests for analytics base URL resolution and update README analytics docs/examples accordingly.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/SupertabConnect.php Introduces a dedicated analytics base URL with static getters/setters and constructor override, wiring it into the default HTTP analytics transport.
tests/SupertabConnectAnalyticsBaseUrlTest.php Adds coverage for default/override/precedence behavior of the analytics base URL.
README.md Documents the new analytics host behavior, new configuration option, and new static APIs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread tests/SupertabConnectAnalyticsBaseUrlTest.php
@tomasstark
tomasstark merged commit 5f4470b into main Jul 16, 2026
5 checks passed
@tomasstark
tomasstark deleted the feat/analytics-ingest-default branch July 16, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants