Skip to content

Commit 958cdc8

Browse files
committed
Update API host constants and adjust remote metrics to use NAYLA_API_HOST
1 parent 3f15dfa commit 958cdc8

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export const SEGMENT_API_HOST = 'api.segment.io/v1'
2+
export const NAYLA_API_HOST = 'api.nayla.ai'

packages/browser/src/core/stats/remote-metrics.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { fetch } from '../../lib/fetch'
22
import { version } from '../../generated/version'
33
import { getVersionType } from '../../lib/version-type'
4-
import { SEGMENT_API_HOST } from '../constants'
4+
import { SEGMENT_API_HOST, NAYLA_API_HOST } from '../constants'
55

66
export interface MetricsOptions {
77
host?: string
@@ -63,7 +63,7 @@ export class RemoteMetrics {
6363
queue: RemoteMetric[]
6464

6565
constructor(options?: MetricsOptions) {
66-
this.host = options?.host ?? SEGMENT_API_HOST
66+
this.host = options?.host ?? NAYLA_API_HOST
6767
this.sampleRate = options?.sampleRate ?? 1
6868
this.flushTimer = options?.flushTimer ?? 30 * 1000 /* 30s */
6969
this.maxQueueSize = options?.maxQueueSize ?? 20

packages/browser/src/plugins/segmentio/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import batch from './batched-dispatcher'
1111
import standard from './fetch-dispatcher'
1212
import { normalize } from './normalize'
1313
import { scheduleFlush } from './schedule-flush'
14-
import { SEGMENT_API_HOST } from '../../core/constants'
14+
import { SEGMENT_API_HOST, NAYLA_API_HOST } from '../../core/constants'
1515
import { DeliveryStrategy } from './shared-dispatcher'
1616

1717
export type SegmentioSettings = {
@@ -78,7 +78,7 @@ export function segmentio(
7878
const inflightEvents = new Set<Context>()
7979
const flushing = false
8080

81-
const apiHost = settings?.apiHost ?? SEGMENT_API_HOST
81+
const apiHost = settings?.apiHost ?? NAYLA_API_HOST
8282
const protocol = settings?.protocol ?? 'https'
8383
const remote = `${protocol}://${apiHost}`
8484

packages/browser/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"moduleResolution": "node",
77
"resolveJsonModule": true,
88
"lib": ["es2020", "DOM", "DOM.Iterable"],
9-
"baseUrl": "./src",
10-
"keyofStringsOnly": true
9+
"baseUrl": "./src"
1110
},
1211
"exclude": ["node_modules", "dist"]
1312
}

0 commit comments

Comments
 (0)