Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding apiHost from segment.io settings, or default #1160

Merged
merged 5 commits into from
Sep 27, 2024

Conversation

MichaelGHSeg
Copy link
Contributor

Note that cdnURL has to include protocol (https://), but apiHost must not)

  • I've included a changeset (psst. run yarn changeset. Read about changesets here).

Copy link

changeset-bot bot commented Sep 26, 2024

🦋 Changeset detected

Latest commit: c143e4f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@segment/analytics-next Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

const segmentLoadOptions = options?.integrations?.['Segment.io'] as
| SegmentioSettings
| undefined
const apiHost = segmentLoadOptions?.apiHost
Copy link
Contributor

@silesky silesky Sep 26, 2024

Choose a reason for hiding this comment

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

This isn't the final value afaik? these loadOptions are just overrides -- we would need to take into account the cdnSettings apiHost value.

One option is to just make this a getter to analytics.queue and create a metadata object on the plugin -- that way, don't have to recreate the logic in two places.

@MichaelGHSeg MichaelGHSeg merged commit bedea03 into master Sep 27, 2024
6 checks passed
@MichaelGHSeg MichaelGHSeg deleted the MichaelGHSeg/api-host-api branch September 27, 2024 18:17
@github-actions github-actions bot mentioned this pull request Sep 27, 2024
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