Skip to content

Commit

Permalink
fix: Only use the custom endpoint on frontend calls
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Ehrlich <[email protected]>
  • Loading branch information
bahlo and c-ehrlich committed Sep 6, 2024
1 parent db0f477 commit 57fc919
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ node_modules/
dist/
.vscode/
coverage/
.envrc
.envrc
/.env
4 changes: 2 additions & 2 deletions src/platform/generic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ export default class GenericConfig implements Provider {
}

getLogsEndpoint(): string {
if (this.customEndpoint) {
if (isBrowser && this.customEndpoint) {
return this.customEndpoint
}

return isBrowser ? `${this.proxyPath}/logs` : this.getIngestURL(EndpointType.logs);
}

getWebVitalsEndpoint(): string {
if (this.customEndpoint) {
if (isBrowser && this.customEndpoint) {
return this.customEndpoint
}

Expand Down
4 changes: 2 additions & 2 deletions src/platform/vercel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ export default class VercelConfig extends GenericConfig implements Provider {
}

getWebVitalsEndpoint(): string {
if (this.customEndpoint) {
if (isBrowser && this.customEndpoint) {
return this.customEndpoint
}

return `${this.proxyPath}/web-vitals`;
}

getLogsEndpoint(): string {
if (this.customEndpoint) {
if (isBrowser && this.customEndpoint) {
return this.customEndpoint
}

Expand Down

0 comments on commit 57fc919

Please sign in to comment.