Skip to content

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

Merged
MichaelGHSeg merged 5 commits intomasterfrom
MichaelGHSeg/api-host-api
Sep 27, 2024
Merged

Adding apiHost from segment.io settings, or default#1160
MichaelGHSeg merged 5 commits intomasterfrom
MichaelGHSeg/api-host-api

Conversation

@MichaelGHSeg
Copy link
Copy Markdown
Collaborator

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).

@changeset-bot
Copy link
Copy Markdown

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
Copy Markdown
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.

@silesky silesky force-pushed the MichaelGHSeg/api-host-api branch from 6b679a5 to b50f7b1 Compare September 26, 2024 21:15
@MichaelGHSeg MichaelGHSeg merged commit bedea03 into master Sep 27, 2024
@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