@proveanything/smartlinks 1.7.10 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.7.10 | Generated: 2026-03-12T18:05:02.102Z
3
+ Version: 1.8.0 | Generated: 2026-03-12T19:37:47.506Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -71,6 +71,7 @@ The Smartlinks SDK is organized into the following namespaces:
71
71
  - **serialNumber** - Assign, lookup, and manage serial numbers across scopes.
72
72
 
73
73
  — Other —
74
+ - **analytics** - Functions for analytics operations
74
75
  - **appObjects** - Functions for appObjects operations
75
76
  - **async** - Functions for async operations
76
77
  - **attestation** - Functions for attestation operations
@@ -924,6 +925,343 @@ interface AISearchPhotosPhoto {
924
925
  }
925
926
  ```
926
927
 
928
+ ### analytics
929
+
930
+ **AnalyticsLocation** (interface)
931
+ ```typescript
932
+ interface AnalyticsLocation {
933
+ country?: string
934
+ latitude?: number
935
+ longitude?: number
936
+ area?: number
937
+ [key: string]: any
938
+ }
939
+ ```
940
+
941
+ **AnalyticsStandardMetadataFields** (interface)
942
+ ```typescript
943
+ interface AnalyticsStandardMetadataFields {
944
+ visitorId?: string
945
+ referrer?: string
946
+ referrerHost?: string
947
+ utmSource?: string
948
+ utmMedium?: string
949
+ utmCampaign?: string
950
+ utmContent?: string
951
+ utmTerm?: string
952
+ entryType?: string
953
+ group?: string
954
+ tag?: string
955
+ campaign?: string
956
+ placement?: string
957
+ linkGroup?: string
958
+ linkPlacement?: string
959
+ linkPosition?: string | number
960
+ linkTitle?: string
961
+ destinationDomain?: string
962
+ pagePath?: string
963
+ pageId?: string
964
+ qrCodeId?: string
965
+ scanMethod?: string
966
+ }
967
+ ```
968
+
969
+ **AnalyticsTrackOptions** (interface)
970
+ ```typescript
971
+ interface AnalyticsTrackOptions {
972
+ preferBeacon?: boolean
973
+ }
974
+ ```
975
+
976
+ **AnalyticsBrowserConfig** (interface)
977
+ ```typescript
978
+ interface AnalyticsBrowserConfig {
979
+ sessionStorageKey?: string
980
+ sessionIdFactory?: () => string
981
+ visitorId?: string
982
+ visitorStorage?: AnalyticsStorageMode
983
+ visitorStorageKey?: string
984
+ visitorIdFactory?: () => string
985
+ autoCaptureCampaignParams?: boolean
986
+ campaignParamMap?: Partial<Record<keyof AnalyticsStandardMetadataFields, string | string[]>>
987
+ defaultCollectionEvent?: Partial<CollectionAnalyticsEvent>
988
+ defaultTagEvent?: Partial<TagAnalyticsEvent>
989
+ getCollectionDefaults?: () => Partial<CollectionAnalyticsEvent> | undefined
990
+ getTagDefaults?: () => Partial<TagAnalyticsEvent> | undefined
991
+ getLocation?: () => AnalyticsLocation | null | undefined
992
+ }
993
+ ```
994
+
995
+ **AnalyticsVisitorIdOptions** (interface)
996
+ ```typescript
997
+ interface AnalyticsVisitorIdOptions {
998
+ persist?: boolean
999
+ storage?: AnalyticsStorageMode
1000
+ storageKey?: string
1001
+ }
1002
+ ```
1003
+
1004
+ **AnalyticsPageViewBindingOptions** (interface)
1005
+ ```typescript
1006
+ interface AnalyticsPageViewBindingOptions {
1007
+ trackInitialPageView?: boolean
1008
+ includeHashChanges?: boolean
1009
+ event?: Partial<CollectionAnalyticsEvent>
1010
+ trackOptions?: AnalyticsTrackOptions
1011
+ getEvent?: (path: string) => Partial<CollectionAnalyticsEvent> | null | undefined
1012
+ }
1013
+ ```
1014
+
1015
+ **AnalyticsLinkBindingOptions** (interface)
1016
+ ```typescript
1017
+ interface AnalyticsLinkBindingOptions {
1018
+ root?: Document | HTMLElement
1019
+ selector?: string
1020
+ trackInternal?: boolean
1021
+ event?: Partial<CollectionAnalyticsEvent>
1022
+ trackOptions?: AnalyticsTrackOptions
1023
+ getEvent?: (anchor: HTMLAnchorElement, event: MouseEvent) => Partial<CollectionAnalyticsEvent> | null | undefined
1024
+ }
1025
+ ```
1026
+
1027
+ **AnalyticsTrackResult** (interface)
1028
+ ```typescript
1029
+ interface AnalyticsTrackResult {
1030
+ queued: boolean
1031
+ transport: 'beacon' | 'fetch' | 'unavailable'
1032
+ }
1033
+ ```
1034
+
1035
+ **AnalyticsFilterRequest** (interface)
1036
+ ```typescript
1037
+ interface AnalyticsFilterRequest {
1038
+ source?: AnalyticsSource
1039
+ from?: string
1040
+ to?: string
1041
+ eventType?: string
1042
+ eventTypes?: string[]
1043
+ productId?: string
1044
+ productIds?: string[]
1045
+ proofId?: string
1046
+ proofIds?: string[]
1047
+ batchId?: string
1048
+ batchIds?: string[]
1049
+ variantId?: string
1050
+ variantIds?: string[]
1051
+ sessionId?: string
1052
+ sessionIds?: string[]
1053
+ country?: string
1054
+ countries?: string[]
1055
+ metadata?: Record<string, any>
1056
+ appId?: string
1057
+ appIds?: string[]
1058
+ destinationAppId?: string
1059
+ destinationAppIds?: string[]
1060
+ linkId?: string
1061
+ linkIds?: string[]
1062
+ href?: string
1063
+ path?: string
1064
+ hrefContains?: string
1065
+ pathContains?: string
1066
+ isExternal?: boolean
1067
+ codeId?: string
1068
+ codeIds?: string[]
1069
+ claimId?: string
1070
+ claimIds?: string[]
1071
+ isAdmin?: boolean
1072
+ hasLocation?: boolean
1073
+ }
1074
+ ```
1075
+
1076
+ **AnalyticsSummaryData** (interface)
1077
+ ```typescript
1078
+ interface AnalyticsSummaryData {
1079
+ totalEvents?: number
1080
+ uniqueSessions?: number
1081
+ uniqueVisitors?: number
1082
+ uniqueCountries?: number
1083
+ uniqueLinks?: number
1084
+ externalEvents?: number
1085
+ internalEvents?: number
1086
+ firstEventAt?: string | null
1087
+ lastEventAt?: string | null
1088
+ uniqueCodes?: number
1089
+ uniqueClaims?: number
1090
+ adminEvents?: number
1091
+ customerEvents?: number
1092
+ locationEvents?: number
1093
+ [key: string]: any
1094
+ }
1095
+ ```
1096
+
1097
+ **AnalyticsSummaryResponse** (interface)
1098
+ ```typescript
1099
+ interface AnalyticsSummaryResponse {
1100
+ source: AnalyticsSource
1101
+ summary: AnalyticsSummaryData
1102
+ }
1103
+ ```
1104
+
1105
+ **AnalyticsTimeseriesRow** (interface)
1106
+ ```typescript
1107
+ interface AnalyticsTimeseriesRow {
1108
+ period: string
1109
+ count: number
1110
+ uniqueSessions?: number
1111
+ uniqueVisitors?: number
1112
+ value: number
1113
+ [key: string]: any
1114
+ }
1115
+ ```
1116
+
1117
+ **AnalyticsTimeseriesResponse** (interface)
1118
+ ```typescript
1119
+ interface AnalyticsTimeseriesResponse {
1120
+ source: AnalyticsSource
1121
+ granularity: AnalyticsGranularity
1122
+ metric: AnalyticsMetric
1123
+ rows: AnalyticsTimeseriesRow[]
1124
+ }
1125
+ ```
1126
+
1127
+ **AnalyticsBreakdownRow** (interface)
1128
+ ```typescript
1129
+ interface AnalyticsBreakdownRow {
1130
+ dimensionValue: string | number | boolean | null
1131
+ count: number
1132
+ uniqueSessions?: number
1133
+ uniqueVisitors?: number
1134
+ value: number
1135
+ [key: string]: any
1136
+ }
1137
+ ```
1138
+
1139
+ **AnalyticsBreakdownResponse** (interface)
1140
+ ```typescript
1141
+ interface AnalyticsBreakdownResponse {
1142
+ source: AnalyticsSource
1143
+ dimension: string
1144
+ metric: AnalyticsMetric
1145
+ rows: AnalyticsBreakdownRow[]
1146
+ }
1147
+ ```
1148
+
1149
+ **AnalyticsEventsResponse** (interface)
1150
+ ```typescript
1151
+ interface AnalyticsEventsResponse {
1152
+ source: AnalyticsSource
1153
+ limit: number
1154
+ offset: number
1155
+ sort: 'ASC' | 'DESC'
1156
+ count: number
1157
+ rows: Array<Record<string, any>>
1158
+ }
1159
+ ```
1160
+
1161
+ **LegacyAnalyticsRequest** (interface)
1162
+ ```typescript
1163
+ interface LegacyAnalyticsRequest {
1164
+ collection?: string
1165
+ collectionId?: string
1166
+ productId?: string
1167
+ appId?: string
1168
+ startDate?: string
1169
+ endDate?: string
1170
+ location?: string
1171
+ tagId?: string
1172
+ qrCodeUrl?: string
1173
+ [key: string]: any
1174
+ }
1175
+ ```
1176
+
1177
+ **AnalyticsDashboardMetrics** (interface)
1178
+ ```typescript
1179
+ interface AnalyticsDashboardMetrics {
1180
+ [key: string]: string | number | null
1181
+ }
1182
+ ```
1183
+
1184
+ **AnalyticsDashboardCharts** (interface)
1185
+ ```typescript
1186
+ interface AnalyticsDashboardCharts {
1187
+ [key: string]: any[]
1188
+ }
1189
+ ```
1190
+
1191
+ **AnalyticsDashboardResponse** (interface)
1192
+ ```typescript
1193
+ interface AnalyticsDashboardResponse {
1194
+ metrics: AnalyticsDashboardMetrics
1195
+ charts: AnalyticsDashboardCharts
1196
+ locationData: any[]
1197
+ }
1198
+ ```
1199
+
1200
+ **AnalyticsProductsRow** (interface)
1201
+ ```typescript
1202
+ interface AnalyticsProductsRow {
1203
+ productId: string
1204
+ totalEvents: number
1205
+ }
1206
+ ```
1207
+
1208
+ **AnalyticsProductsResponse** (interface)
1209
+ ```typescript
1210
+ interface AnalyticsProductsResponse {
1211
+ products: string[]
1212
+ rows: AnalyticsProductsRow[]
1213
+ }
1214
+ ```
1215
+
1216
+ **AnalyticsQrCodeRow** (interface)
1217
+ ```typescript
1218
+ interface AnalyticsQrCodeRow {
1219
+ href: string
1220
+ visits: number
1221
+ displayName: string
1222
+ code: string
1223
+ }
1224
+ ```
1225
+
1226
+ **AnalyticsTagRow** (interface)
1227
+ ```typescript
1228
+ interface AnalyticsTagRow {
1229
+ tagId: string
1230
+ claimId: string
1231
+ codeId: string
1232
+ displayName: string
1233
+ scans: number
1234
+ activeDays: number
1235
+ }
1236
+ ```
1237
+
1238
+ **AnalyticsTagsResponse** (interface)
1239
+ ```typescript
1240
+ interface AnalyticsTagsResponse {
1241
+ tags: AnalyticsTagRow[]
1242
+ }
1243
+ ```
1244
+
1245
+ **AnalyticsSource** = `'events' | 'tag'`
1246
+
1247
+ **AnalyticsEventType** = `string`
1248
+
1249
+ **AnalyticsGranularity** = `'hour' | 'day' | 'week' | 'month'`
1250
+
1251
+ **AnalyticsMetric** = `'count' | 'uniqueSessions' | 'uniqueVisitors'`
1252
+
1253
+ **AnalyticsSortOrder** = `'asc' | 'desc'`
1254
+
1255
+ **AnalyticsDeviceType** = `'mobile' | 'tablet' | 'desktop' | 'unknown'`
1256
+
1257
+ **AnalyticsStorageMode** = `'local' | 'session' | false`
1258
+
1259
+ **EventAnalyticsDimension** = ``
1260
+
1261
+ **TagAnalyticsDimension** = ``
1262
+
1263
+ **AnalyticsQrCodesResponse** = `AnalyticsQrCodeRow[]`
1264
+
927
1265
  ### appConfiguration
928
1266
 
929
1267
  **AppConfigurationResponse** (interface)
@@ -1927,6 +2265,97 @@ interface UserAccountRegistrationRequest {
1927
2265
  }
1928
2266
  ```
1929
2267
 
2268
+ **AuthLocation** (interface)
2269
+ ```typescript
2270
+ interface AuthLocation {
2271
+ latitude?: number
2272
+ longitude?: number
2273
+ area?: number
2274
+ country?: string
2275
+ [key: string]: any
2276
+ }
2277
+ ```
2278
+
2279
+ **AuthLocationCacheOptions** (interface)
2280
+ ```typescript
2281
+ interface AuthLocationCacheOptions {
2282
+ cache?: 'session' | false
2283
+ ttlMs?: number
2284
+ storageKey?: string
2285
+ forceRefresh?: boolean
2286
+ }
2287
+ ```
2288
+
2289
+ **AccountFirebaseInfo** (interface)
2290
+ ```typescript
2291
+ interface AccountFirebaseInfo {
2292
+ identities?: Record<string, string[]>
2293
+ sign_in_provider?: string
2294
+ [key: string]: any
2295
+ }
2296
+ ```
2297
+
2298
+ **AccountClientInfo** (interface)
2299
+ ```typescript
2300
+ interface AccountClientInfo {
2301
+ createdAt?: string
2302
+ createdVia?: string
2303
+ [key: string]: any
2304
+ }
2305
+ ```
2306
+
2307
+ **AccountFeatureFlags** (interface)
2308
+ ```typescript
2309
+ interface AccountFeatureFlags {
2310
+ actionLogger?: boolean
2311
+ apiKeys?: boolean
2312
+ analytics?: boolean
2313
+ webhooks?: boolean
2314
+ creating?: boolean
2315
+ helpDocs?: boolean
2316
+ certificateTemplates?: boolean
2317
+ contentLibrary?: boolean
2318
+ devScanner?: boolean
2319
+ appScanner?: boolean
2320
+ [key: string]: boolean | undefined
2321
+ }
2322
+ ```
2323
+
2324
+ **AccountInfoResponse** (interface)
2325
+ ```typescript
2326
+ interface AccountInfoResponse {
2327
+ id: string
2328
+ uid: string
2329
+ userId: string
2330
+ user_id?: string
2331
+ sub: string
2332
+ name: string
2333
+ email: string
2334
+ email_verified: boolean
2335
+ picture?: string | null
2336
+ iss: string
2337
+ aud?: string
2338
+ auth_time: number
2339
+ iat: number
2340
+ exp?: number
2341
+ firebase?: AccountFirebaseInfo
2342
+ accessType?: string
2343
+ clientType?: string
2344
+ analyticsCode?: string
2345
+ analyticsId?: string
2346
+ baseCollectionId?: string
2347
+ collectionGroup?: string
2348
+ contactId?: string
2349
+ features: AccountFeatureFlags
2350
+ adminCollections?: string[]
2351
+ clients?: Record<string, AccountClientInfo>
2352
+ sites?: Record<string, boolean>
2353
+ whitelabel?: Record<string, any>
2354
+ location?: AuthLocation | null
2355
+ [key: string]: any
2356
+ }
2357
+ ```
2358
+
1930
2359
  ### authKit
1931
2360
 
1932
2361
  **AuthKitUser** (interface)
@@ -5345,46 +5774,146 @@ type VerifyTokenResponse = {
5345
5774
  }
5346
5775
  ```
5347
5776
 
5348
- **AccountInfoResponse** (type)
5349
- ```typescript
5350
- type AccountInfoResponse = {
5351
- accessType: string;
5352
- analyticsCode: string;
5353
- analyticsId: string;
5354
- auth_time: number;
5355
- baseCollectionId: string;
5356
- clientType: string;
5357
- email: string;
5358
- email_verified: boolean;
5359
- features: {
5360
- actionLogger: boolean;
5361
- adminCollections: boolean;
5362
- adminApps: boolean;
5363
- apiKeys: boolean;
5364
- adminUsers: boolean;
5365
- [key: string]: boolean;
5366
- };
5367
- iat: number;
5368
- id: string;
5369
- iss: string;
5370
- location: string | null;
5371
- name: string;
5372
- picture: string;
5373
- sites: {
5374
- [siteName: string]: boolean;
5375
- };
5376
- sub: string;
5377
- uid: string;
5378
- userId: string;
5379
- contactId: string
5380
- whitelabel: {
5381
- [key: string]: any;
5382
- }
5383
- }
5384
- ```
5385
-
5386
5777
  ## API Functions
5387
5778
 
5779
+ ### analytics
5780
+
5781
+ **track**(event: CollectionAnalyticsEvent,
5782
+ options?: AnalyticsTrackOptions) → `AnalyticsTrackResult`
5783
+ Fire-and-forget collection analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5784
+
5785
+ **track**(event: TagAnalyticsEvent,
5786
+ options?: AnalyticsTrackOptions) → `AnalyticsTrackResult`
5787
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5788
+
5789
+ **configure**(config: AnalyticsBrowserConfig) → `void`
5790
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5791
+
5792
+ **getSessionId**() → `string | undefined`
5793
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5794
+
5795
+ **getVisitorId**() → `string | undefined`
5796
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5797
+
5798
+ **setVisitorId**(visitorId: string,
5799
+ options?: AnalyticsVisitorIdOptions) → `string`
5800
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5801
+
5802
+ **clearVisitorId**(options?: Pick<AnalyticsVisitorIdOptions, 'storage' | 'storageKey'>) → `void`
5803
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5804
+
5805
+ **captureCampaignParams**(search?: string) → `Partial<CollectionAnalyticsEvent>`
5806
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5807
+
5808
+ **setLocation**(location: TagAnalyticsEvent['location'] | null) → `void`
5809
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5810
+
5811
+ **clearLocation**() → `void`
5812
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5813
+
5814
+ **getLocation**() → `TagAnalyticsEvent['location'] | undefined`
5815
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5816
+
5817
+ **detectDevice**() → `CollectionAnalyticsEvent['deviceType']`
5818
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5819
+
5820
+ **captureLocation**(options: AnalyticsGeolocationCaptureOptions = {}) → `Promise<TagAnalyticsEvent['location'] | null>`
5821
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5822
+
5823
+ **trackCollection**(event: Partial<CollectionAnalyticsEvent>,
5824
+ options?: AnalyticsTrackOptions) → `AnalyticsTrackResult`
5825
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5826
+
5827
+ **trackTag**(event: Partial<TagAnalyticsEvent>,
5828
+ options?: AnalyticsTrackOptions) → `AnalyticsTrackResult`
5829
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5830
+
5831
+ **trackPageView**(event: Partial<CollectionAnalyticsEvent>,
5832
+ options?: AnalyticsTrackOptions) → `AnalyticsTrackResult`
5833
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5834
+
5835
+ **trackLinkClick**(event: AnalyticsLinkClickInput,
5836
+ options?: AnalyticsTrackOptions) → `AnalyticsTrackResult`
5837
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5838
+
5839
+ **trackTagScan**(event: Partial<TagAnalyticsEvent>,
5840
+ options?: AnalyticsTrackOptions) → `AnalyticsTrackResult`
5841
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5842
+
5843
+ **bindPageViews**(binding: AnalyticsPageViewBindingOptions = {}) → `() => void`
5844
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5845
+
5846
+ **bindLinkTracking**(binding: AnalyticsLinkBindingOptions = {}) → `() => void`
5847
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5848
+
5849
+ **summary**(collectionId: string,
5850
+ body: AnalyticsSummaryRequest) → `Promise<AnalyticsSummaryResponse>`
5851
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5852
+
5853
+ **timeseries**(collectionId: string,
5854
+ body: AnalyticsTimeseriesRequest) → `Promise<AnalyticsTimeseriesResponse>`
5855
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5856
+
5857
+ **breakdown**(collectionId: string,
5858
+ body: AnalyticsBreakdownRequest) → `Promise<AnalyticsBreakdownResponse>`
5859
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5860
+
5861
+ **events**(collectionId: string,
5862
+ body: AnalyticsEventsRequest) → `Promise<AnalyticsEventsResponse>`
5863
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5864
+
5865
+ **web**(collectionId: string,
5866
+ body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsDashboardResponse>`
5867
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5868
+
5869
+ **clicks**(collectionId: string,
5870
+ body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsDashboardResponse>`
5871
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5872
+
5873
+ **tagScans**(collectionId: string,
5874
+ body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsDashboardResponse>`
5875
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5876
+
5877
+ **products**(collectionId: string,
5878
+ body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsProductsResponse>`
5879
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5880
+
5881
+ **qrCodes**(collectionId: string,
5882
+ body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsQrCodesResponse>`
5883
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5884
+
5885
+ **tags**(collectionId: string,
5886
+ body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsTagsResponse>`
5887
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5888
+
5889
+ **weekly**(collectionId: string,
5890
+ body: AnalyticsWeeklyRequest = {}) → `Promise<AnalyticsTimeseriesResponse>`
5891
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5892
+
5893
+ **country**(collectionId: string,
5894
+ body: AnalyticsCountryRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
5895
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5896
+
5897
+ **topPages**(collectionId: string,
5898
+ body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
5899
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5900
+
5901
+ **topReferrers**(collectionId: string,
5902
+ body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
5903
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5904
+
5905
+ **topCampaigns**(collectionId: string,
5906
+ body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
5907
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5908
+
5909
+ **topSources**(collectionId: string,
5910
+ body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
5911
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5912
+
5913
+ **topDestinations**(collectionId: string,
5914
+ body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
5915
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5916
+
5388
5917
  ### app
5389
5918
 
5390
5919
  **create**(collectionId: string,
@@ -5668,8 +6197,14 @@ Tries to register a new user account. Can return a bearer token, or a Firebase t
5668
6197
  }) → `Promise<`
5669
6198
  Admin: Get a user bearer token (impersonation/automation). POST /admin/auth/userToken All fields are optional; at least one identifier should be provided.
5670
6199
 
6200
+ **getLocation**(options: AuthLocationCacheOptions = {}) → `Promise<AuthLocation>`
6201
+ Gets a best-effort coarse location for the current anonymous caller. This endpoint is typically IP-derived and is useful when the user is not logged in but you still want country/location context for content rules, analytics enrichment, or regional defaults. Returns fields such as `country`, `latitude`, `longitude`, and `area` when available. By default the result is cached in session storage for 30 minutes so apps can reuse coarse location context without repeatedly hitting the endpoint.
6202
+
6203
+ **clearCachedLocation**(storageKey: string = DEFAULT_AUTH_LOCATION_CACHE_KEY) → `void`
6204
+ Clears the cached anonymous auth location, if present.
6205
+
5671
6206
  **getAccount**() → `Promise<AccountInfoResponse>`
5672
- Gets current account information for the logged in user. Returns user, owner, account, and location objects. Short-circuits immediately (no network request) when the SDK has no bearer token or API key set — the server would return 401 anyway. Throws a `SmartlinksApiError` with `statusCode 401` and `details.local = true` so callers can distinguish "never authenticated" from an actual server-side token rejection. This short-circuit is skipped when proxy mode is enabled, because in that case credentials are held by the parent frame and the local SDK may have no token set yet — the request must be forwarded to the parent to determine whether the user is authenticated.
6207
+ Gets current account information for the logged in user. Returns user, owner, account, and location objects. When the caller is authenticated, prefer `account.location` from this response. For anonymous callers, use `auth.getLocation()` instead. Short-circuits immediately (no network request) when the SDK has no bearer token or API key set — the server would return 401 anyway. Throws a `SmartlinksApiError` with `statusCode 401` and `details.local = true` so callers can distinguish "never authenticated" from an actual server-side token rejection. This short-circuit is skipped when proxy mode is enabled, because in that case credentials are held by the parent frame and the local SDK may have no token set yet — the request must be forwarded to the parent to determine whether the user is authenticated.
5673
6208
 
5674
6209
  ### authKit
5675
6210