feat: default analytics to the dedicated ingest service - #25
Merged
Conversation
Contributor
There was a problem hiding this comment.
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::$analyticsBaseUrldefaulting to the ingest service, plussetAnalyticsBaseUrl()/getAnalyticsBaseUrl(). - Add a per-instance
analyticsBaseUrlconstructor 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.
…lt; README lists null as the param default
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/eventspath 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: trueshifts its ingest traffic onto the standalone service on upgrade, draining ingest load off the main API.Key Changes
$analyticsBaseUrldefaulting to the ingest service, wired into the defaultHttpAnalyticsTransportin place of the API base URL.analyticsBaseUrlconstructor option plus staticsetAnalyticsBaseUrl()/getAnalyticsBaseUrl(), mirroringbaseUrl/setBaseUrl(). Precedence matches TS: per-instance option > static setter > ingest default; the per-instance option does not mutate the global.analytics base URL resolutioncases: default host, both overrides, precedence, and independence fromsetBaseUrl().Ref: connect-sdk-typescript#41