diff --git a/common/changes/@snowplow/browser-tracker/fix-remove-newTracker-faulty-typing_2023-09-13-09-52.json b/common/changes/@snowplow/browser-tracker/fix-remove-newTracker-faulty-typing_2023-09-13-09-52.json new file mode 100644 index 000000000..c1b673840 --- /dev/null +++ b/common/changes/@snowplow/browser-tracker/fix-remove-newTracker-faulty-typing_2023-09-13-09-52.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@snowplow/browser-tracker", + "comment": "Fix newTracker typing for better understanding of arguments", + "type": "none" + } + ], + "packageName": "@snowplow/browser-tracker" +} \ No newline at end of file diff --git a/trackers/browser-tracker/src/index.ts b/trackers/browser-tracker/src/index.ts index 77e38af65..4a8669dc8 100644 --- a/trackers/browser-tracker/src/index.ts +++ b/trackers/browser-tracker/src/index.ts @@ -50,7 +50,7 @@ const state = typeof window !== 'undefined' ? createSharedState() : undefined; * @param endpoint - Collector endpoint in the form collector.mysite.com * @param configuration - The initialisation options of the tracker */ -export function newTracker(trackerId: string, endpoint: string, configuration: TrackerConfiguration = {}) { +export function newTracker(trackerId: string, endpoint: string, configuration?: TrackerConfiguration) { if (state) { return addTracker(trackerId, trackerId, `js-${version}`, endpoint, state, configuration); } else {