@proveanything/smartlinks 1.7.10 → 1.8.1

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.1 | Generated: 2026-03-14T09:21:59.178Z
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,345 @@ 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
+ **AnalyticsStandardEventFields** (interface)
942
+ ```typescript
943
+ interface AnalyticsStandardEventFields {
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?: () => AnalyticsSessionId
981
+ visitorId?: string
982
+ visitorStorage?: AnalyticsStorageMode
983
+ visitorStorageKey?: string
984
+ visitorIdFactory?: () => string
985
+ autoCaptureCampaignParams?: boolean
986
+ campaignParamMap?: Partial<Record<keyof AnalyticsStandardEventFields, 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?: AnalyticsSessionId
1052
+ sessionIds?: AnalyticsSessionId[]
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
+ **AnalyticsSessionId** = `number`
1260
+
1261
+ **EventAnalyticsDimension** = ``
1262
+
1263
+ **TagAnalyticsDimension** = ``
1264
+
1265
+ **AnalyticsQrCodesResponse** = `AnalyticsQrCodeRow[]`
1266
+
927
1267
  ### appConfiguration
928
1268
 
929
1269
  **AppConfigurationResponse** (interface)
@@ -1927,6 +2267,97 @@ interface UserAccountRegistrationRequest {
1927
2267
  }
1928
2268
  ```
1929
2269
 
2270
+ **AuthLocation** (interface)
2271
+ ```typescript
2272
+ interface AuthLocation {
2273
+ latitude?: number
2274
+ longitude?: number
2275
+ area?: number
2276
+ country?: string
2277
+ [key: string]: any
2278
+ }
2279
+ ```
2280
+
2281
+ **AuthLocationCacheOptions** (interface)
2282
+ ```typescript
2283
+ interface AuthLocationCacheOptions {
2284
+ cache?: 'session' | false
2285
+ ttlMs?: number
2286
+ storageKey?: string
2287
+ forceRefresh?: boolean
2288
+ }
2289
+ ```
2290
+
2291
+ **AccountFirebaseInfo** (interface)
2292
+ ```typescript
2293
+ interface AccountFirebaseInfo {
2294
+ identities?: Record<string, string[]>
2295
+ sign_in_provider?: string
2296
+ [key: string]: any
2297
+ }
2298
+ ```
2299
+
2300
+ **AccountClientInfo** (interface)
2301
+ ```typescript
2302
+ interface AccountClientInfo {
2303
+ createdAt?: string
2304
+ createdVia?: string
2305
+ [key: string]: any
2306
+ }
2307
+ ```
2308
+
2309
+ **AccountFeatureFlags** (interface)
2310
+ ```typescript
2311
+ interface AccountFeatureFlags {
2312
+ actionLogger?: boolean
2313
+ apiKeys?: boolean
2314
+ analytics?: boolean
2315
+ webhooks?: boolean
2316
+ creating?: boolean
2317
+ helpDocs?: boolean
2318
+ certificateTemplates?: boolean
2319
+ contentLibrary?: boolean
2320
+ devScanner?: boolean
2321
+ appScanner?: boolean
2322
+ [key: string]: boolean | undefined
2323
+ }
2324
+ ```
2325
+
2326
+ **AccountInfoResponse** (interface)
2327
+ ```typescript
2328
+ interface AccountInfoResponse {
2329
+ id: string
2330
+ uid: string
2331
+ userId: string
2332
+ user_id?: string
2333
+ sub: string
2334
+ name: string
2335
+ email: string
2336
+ email_verified: boolean
2337
+ picture?: string | null
2338
+ iss: string
2339
+ aud?: string
2340
+ auth_time: number
2341
+ iat: number
2342
+ exp?: number
2343
+ firebase?: AccountFirebaseInfo
2344
+ accessType?: string
2345
+ clientType?: string
2346
+ analyticsCode?: string
2347
+ analyticsId?: string
2348
+ baseCollectionId?: string
2349
+ collectionGroup?: string
2350
+ contactId?: string
2351
+ features: AccountFeatureFlags
2352
+ adminCollections?: string[]
2353
+ clients?: Record<string, AccountClientInfo>
2354
+ sites?: Record<string, boolean>
2355
+ whitelabel?: Record<string, any>
2356
+ location?: AuthLocation | null
2357
+ [key: string]: any
2358
+ }
2359
+ ```
2360
+
1930
2361
  ### authKit
1931
2362
 
1932
2363
  **AuthKitUser** (interface)
@@ -5345,46 +5776,146 @@ type VerifyTokenResponse = {
5345
5776
  }
5346
5777
  ```
5347
5778
 
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
5779
  ## API Functions
5387
5780
 
5781
+ ### analytics
5782
+
5783
+ **track**(event: CollectionAnalyticsEvent,
5784
+ options?: AnalyticsTrackOptions) → `AnalyticsTrackResult`
5785
+ Fire-and-forget collection analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5786
+
5787
+ **track**(event: TagAnalyticsEvent,
5788
+ options?: AnalyticsTrackOptions) → `AnalyticsTrackResult`
5789
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5790
+
5791
+ **configure**(config: AnalyticsBrowserConfig) → `void`
5792
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5793
+
5794
+ **getSessionId**() → `AnalyticsSessionId | undefined`
5795
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5796
+
5797
+ **getVisitorId**() → `string | undefined`
5798
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5799
+
5800
+ **setVisitorId**(visitorId: string,
5801
+ options?: AnalyticsVisitorIdOptions) → `string`
5802
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5803
+
5804
+ **clearVisitorId**(options?: Pick<AnalyticsVisitorIdOptions, 'storage' | 'storageKey'>) → `void`
5805
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5806
+
5807
+ **captureCampaignParams**(search?: string) → `Partial<CollectionAnalyticsEvent>`
5808
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5809
+
5810
+ **setLocation**(location: TagAnalyticsEvent['location'] | null) → `void`
5811
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5812
+
5813
+ **clearLocation**() → `void`
5814
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5815
+
5816
+ **getLocation**() → `TagAnalyticsEvent['location'] | undefined`
5817
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5818
+
5819
+ **detectDevice**() → `CollectionAnalyticsEvent['deviceType']`
5820
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5821
+
5822
+ **captureLocation**(options: AnalyticsGeolocationCaptureOptions = {}) → `Promise<TagAnalyticsEvent['location'] | null>`
5823
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5824
+
5825
+ **trackCollection**(event: Partial<CollectionAnalyticsEvent>,
5826
+ options?: AnalyticsTrackOptions) → `AnalyticsTrackResult`
5827
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5828
+
5829
+ **trackTag**(event: Partial<TagAnalyticsEvent>,
5830
+ options?: AnalyticsTrackOptions) → `AnalyticsTrackResult`
5831
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5832
+
5833
+ **trackPageView**(event: Partial<CollectionAnalyticsEvent>,
5834
+ options?: AnalyticsTrackOptions) → `AnalyticsTrackResult`
5835
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5836
+
5837
+ **trackLinkClick**(event: AnalyticsLinkClickInput,
5838
+ options?: AnalyticsTrackOptions) → `AnalyticsTrackResult`
5839
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5840
+
5841
+ **trackTagScan**(event: Partial<TagAnalyticsEvent>,
5842
+ options?: AnalyticsTrackOptions) → `AnalyticsTrackResult`
5843
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5844
+
5845
+ **bindPageViews**(binding: AnalyticsPageViewBindingOptions = {}) → `() => void`
5846
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5847
+
5848
+ **bindLinkTracking**(binding: AnalyticsLinkBindingOptions = {}) → `() => void`
5849
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5850
+
5851
+ **summary**(collectionId: string,
5852
+ body: AnalyticsSummaryRequest) → `Promise<AnalyticsSummaryResponse>`
5853
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5854
+
5855
+ **timeseries**(collectionId: string,
5856
+ body: AnalyticsTimeseriesRequest) → `Promise<AnalyticsTimeseriesResponse>`
5857
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5858
+
5859
+ **breakdown**(collectionId: string,
5860
+ body: AnalyticsBreakdownRequest) → `Promise<AnalyticsBreakdownResponse>`
5861
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5862
+
5863
+ **events**(collectionId: string,
5864
+ body: AnalyticsEventsRequest) → `Promise<AnalyticsEventsResponse>`
5865
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5866
+
5867
+ **web**(collectionId: string,
5868
+ body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsDashboardResponse>`
5869
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5870
+
5871
+ **clicks**(collectionId: string,
5872
+ body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsDashboardResponse>`
5873
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5874
+
5875
+ **tagScans**(collectionId: string,
5876
+ body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsDashboardResponse>`
5877
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5878
+
5879
+ **products**(collectionId: string,
5880
+ body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsProductsResponse>`
5881
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5882
+
5883
+ **qrCodes**(collectionId: string,
5884
+ body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsQrCodesResponse>`
5885
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5886
+
5887
+ **tags**(collectionId: string,
5888
+ body: LegacyAnalyticsRequest = {}) → `Promise<AnalyticsTagsResponse>`
5889
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5890
+
5891
+ **weekly**(collectionId: string,
5892
+ body: AnalyticsWeeklyRequest = {}) → `Promise<AnalyticsTimeseriesResponse>`
5893
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5894
+
5895
+ **country**(collectionId: string,
5896
+ body: AnalyticsCountryRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
5897
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5898
+
5899
+ **topPages**(collectionId: string,
5900
+ body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
5901
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5902
+
5903
+ **topReferrers**(collectionId: string,
5904
+ body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
5905
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5906
+
5907
+ **topCampaigns**(collectionId: string,
5908
+ body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
5909
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5910
+
5911
+ **topSources**(collectionId: string,
5912
+ body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
5913
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5914
+
5915
+ **topDestinations**(collectionId: string,
5916
+ body: AnalyticsClassicReportRequest = {}) → `Promise<AnalyticsBreakdownResponse>`
5917
+ Fire-and-forget tag analytics event. Uses `navigator.sendBeacon()` when available, falling back to `fetch(..., { keepalive: true })`.
5918
+
5388
5919
  ### app
5389
5920
 
5390
5921
  **create**(collectionId: string,
@@ -5668,8 +6199,14 @@ Tries to register a new user account. Can return a bearer token, or a Firebase t
5668
6199
  }) → `Promise<`
5669
6200
  Admin: Get a user bearer token (impersonation/automation). POST /admin/auth/userToken All fields are optional; at least one identifier should be provided.
5670
6201
 
6202
+ **getLocation**(options: AuthLocationCacheOptions = {}) → `Promise<AuthLocation>`
6203
+ 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.
6204
+
6205
+ **clearCachedLocation**(storageKey: string = DEFAULT_AUTH_LOCATION_CACHE_KEY) → `void`
6206
+ Clears the cached anonymous auth location, if present.
6207
+
5671
6208
  **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.
6209
+ 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
6210
 
5674
6211
  ### authKit
5675
6212