@proveanything/smartlinks 1.7.9 → 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.
- package/README.md +3 -0
- package/dist/api/analytics.d.ts +57 -0
- package/dist/api/analytics.js +542 -0
- package/dist/api/auth.d.ts +23 -35
- package/dist/api/auth.js +104 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/order.d.ts +14 -5
- package/dist/api/order.js +19 -8
- package/dist/docs/API_SUMMARY.md +595 -64
- package/dist/docs/analytics-metadata-conventions.md +80 -0
- package/dist/docs/analytics.md +690 -0
- package/dist/docs/interactions.md +2 -0
- package/dist/docs/overview.md +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/openapi.yaml +853 -115
- package/dist/types/analytics.d.ts +307 -0
- package/dist/types/analytics.js +7 -1
- package/dist/types/auth.d.ts +67 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/order.d.ts +25 -28
- package/docs/API_SUMMARY.md +595 -64
- package/docs/analytics-metadata-conventions.md +80 -0
- package/docs/analytics.md +690 -0
- package/docs/interactions.md +2 -0
- package/docs/overview.md +2 -1
- package/openapi.yaml +853 -115
- package/package.json +1 -1
package/dist/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.
|
|
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)
|
|
@@ -4503,38 +4932,34 @@ interface GetOrderItemsResponse {
|
|
|
4503
4932
|
}
|
|
4504
4933
|
```
|
|
4505
4934
|
|
|
4506
|
-
**
|
|
4507
|
-
```typescript
|
|
4508
|
-
interface QueryOrderItemFilter {
|
|
4509
|
-
productId: string
|
|
4510
|
-
batchId?: string
|
|
4511
|
-
variantId?: string
|
|
4512
|
-
}
|
|
4513
|
-
```
|
|
4514
|
-
|
|
4515
|
-
**QueryOrdersFilter** (interface)
|
|
4935
|
+
**QueryOrdersRequest** (interface)
|
|
4516
4936
|
```typescript
|
|
4517
|
-
interface
|
|
4937
|
+
interface QueryOrdersRequest {
|
|
4938
|
+
query?: {
|
|
4518
4939
|
status?: string
|
|
4519
4940
|
orderRef?: string
|
|
4520
4941
|
customerId?: string
|
|
4521
|
-
createdAfter?: string
|
|
4522
|
-
createdBefore?: string
|
|
4523
|
-
updatedAfter?: string
|
|
4524
|
-
updatedBefore?: string
|
|
4942
|
+
createdAfter?: string // ISO 8601 date
|
|
4943
|
+
createdBefore?: string // ISO 8601 date
|
|
4944
|
+
updatedAfter?: string // ISO 8601 date
|
|
4945
|
+
updatedBefore?: string // ISO 8601 date
|
|
4525
4946
|
minItemCount?: number
|
|
4526
4947
|
maxItemCount?: number
|
|
4948
|
+
productId?: string
|
|
4949
|
+
batchId?: string
|
|
4950
|
+
variantId?: string
|
|
4951
|
+
itemType?: 'tag' | 'proof' | 'serial'
|
|
4952
|
+
itemId?: string
|
|
4953
|
+
itemCollectionId?: string
|
|
4954
|
+
itemMetadata?: Record<string, any>
|
|
4955
|
+
items?: Array<{
|
|
4956
|
+
itemType: 'tag' | 'proof' | 'serial'
|
|
4957
|
+
itemId: string
|
|
4958
|
+
}>
|
|
4527
4959
|
metadata?: Record<string, any>
|
|
4528
|
-
item?: QueryOrderItemFilter
|
|
4529
4960
|
sortBy?: string
|
|
4530
4961
|
sortOrder?: 'asc' | 'desc'
|
|
4531
|
-
}
|
|
4532
|
-
```
|
|
4533
|
-
|
|
4534
|
-
**QueryOrdersRequest** (interface)
|
|
4535
|
-
```typescript
|
|
4536
|
-
interface QueryOrdersRequest {
|
|
4537
|
-
query?: QueryOrdersFilter
|
|
4962
|
+
}
|
|
4538
4963
|
limit?: number // Optional: Max results (default: 100)
|
|
4539
4964
|
offset?: number // Optional: Pagination offset (default: 0)
|
|
4540
4965
|
includeItems?: boolean // Optional: Include items array (default: false)
|
|
@@ -5349,46 +5774,146 @@ type VerifyTokenResponse = {
|
|
|
5349
5774
|
}
|
|
5350
5775
|
```
|
|
5351
5776
|
|
|
5352
|
-
**AccountInfoResponse** (type)
|
|
5353
|
-
```typescript
|
|
5354
|
-
type AccountInfoResponse = {
|
|
5355
|
-
accessType: string;
|
|
5356
|
-
analyticsCode: string;
|
|
5357
|
-
analyticsId: string;
|
|
5358
|
-
auth_time: number;
|
|
5359
|
-
baseCollectionId: string;
|
|
5360
|
-
clientType: string;
|
|
5361
|
-
email: string;
|
|
5362
|
-
email_verified: boolean;
|
|
5363
|
-
features: {
|
|
5364
|
-
actionLogger: boolean;
|
|
5365
|
-
adminCollections: boolean;
|
|
5366
|
-
adminApps: boolean;
|
|
5367
|
-
apiKeys: boolean;
|
|
5368
|
-
adminUsers: boolean;
|
|
5369
|
-
[key: string]: boolean;
|
|
5370
|
-
};
|
|
5371
|
-
iat: number;
|
|
5372
|
-
id: string;
|
|
5373
|
-
iss: string;
|
|
5374
|
-
location: string | null;
|
|
5375
|
-
name: string;
|
|
5376
|
-
picture: string;
|
|
5377
|
-
sites: {
|
|
5378
|
-
[siteName: string]: boolean;
|
|
5379
|
-
};
|
|
5380
|
-
sub: string;
|
|
5381
|
-
uid: string;
|
|
5382
|
-
userId: string;
|
|
5383
|
-
contactId: string
|
|
5384
|
-
whitelabel: {
|
|
5385
|
-
[key: string]: any;
|
|
5386
|
-
}
|
|
5387
|
-
}
|
|
5388
|
-
```
|
|
5389
|
-
|
|
5390
5777
|
## API Functions
|
|
5391
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
|
+
|
|
5392
5917
|
### app
|
|
5393
5918
|
|
|
5394
5919
|
**create**(collectionId: string,
|
|
@@ -5672,8 +6197,14 @@ Tries to register a new user account. Can return a bearer token, or a Firebase t
|
|
|
5672
6197
|
}) → `Promise<`
|
|
5673
6198
|
Admin: Get a user bearer token (impersonation/automation). POST /admin/auth/userToken All fields are optional; at least one identifier should be provided.
|
|
5674
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
|
+
|
|
5675
6206
|
**getAccount**() → `Promise<AccountInfoResponse>`
|
|
5676
|
-
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.
|
|
5677
6208
|
|
|
5678
6209
|
### authKit
|
|
5679
6210
|
|
|
@@ -6430,7 +6961,7 @@ Find all orders containing specific items (tags, proofs, or serial numbers). Use
|
|
|
6430
6961
|
|
|
6431
6962
|
**query**(collectionId: string,
|
|
6432
6963
|
data: QueryOrdersRequest) → `Promise<QueryOrdersResponse>`
|
|
6433
|
-
Advanced query for orders with order-level and item-level filtering. More powerful than the basic list() function. ```typescript // Find pending orders created in January 2026 const result = await order.query('coll_123', { query: { status: 'pending', createdAfter: '2026-01-01T00:00:00Z', createdBefore: '2026-02-01T00:00:00Z', sortBy: 'createdAt', sortOrder: 'desc' }, limit: 50 }) // Find orders with specific metadata and item count const highPriority = await order.query('coll_123', { query: { metadata: { priority: 'high' }, minItemCount: 10, maxItemCount: 100 }, includeItems: true }) // Find orders containing a specific product batch const batchOrders = await order.query('coll_123', { query: {
|
|
6964
|
+
Advanced query for orders with order-level and item-level filtering. More powerful than the basic list() function. ```typescript // Find pending orders created in January 2026 const result = await order.query('coll_123', { query: { status: 'pending', createdAfter: '2026-01-01T00:00:00Z', createdBefore: '2026-02-01T00:00:00Z', sortBy: 'createdAt', sortOrder: 'desc' }, limit: 50 }) // Find orders with specific metadata and item count const highPriority = await order.query('coll_123', { query: { metadata: { priority: 'high' }, minItemCount: 10, maxItemCount: 100 }, includeItems: true }) // Find orders containing a specific product batch const batchOrders = await order.query('coll_123', { query: { productId: 'prod_789', batchId: 'BATCH-2024-001' }, includeItems: true }) // Find an order containing one of several specific items const matched = await order.query('coll_123', { query: { items: [ { itemType: 'tag', itemId: 'TAG001' }, { itemType: 'serial', itemId: 'SN12345' } ] }, includeItems: true }) ```
|
|
6434
6965
|
|
|
6435
6966
|
**reports**(collectionId: string,
|
|
6436
6967
|
params?: ReportsParams) → `Promise<ReportsResponse>`
|