From c101aad3967172c1ab7c6b116f6442f425bcec1e Mon Sep 17 00:00:00 2001
From: Peter Perlepes
Date: Wed, 13 Sep 2023 12:33:25 +0300
Subject: [PATCH] Fix newTracker optional typing
---
...move-newTracker-faulty-typing_2023-09-13-09-52.json | 10 ++++++++++
trackers/browser-tracker/src/index.ts | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
create mode 100644 common/changes/@snowplow/browser-tracker/fix-remove-newTracker-faulty-typing_2023-09-13-09-52.json
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 {