@proveanything/smartlinks 1.7.0 → 1.7.2

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.0 | Generated: 2026-03-03T14:59:10.692Z
3
+ Version: 1.7.2 | Generated: 2026-03-04T07:38:45.571Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -8,9 +8,11 @@ This is a concise summary of all available API functions and types.
8
8
 
9
9
  For detailed guides on specific features:
10
10
 
11
+ - **[SmartLinks Microapp Overview](overview.md)** - Platform architecture, data model, auth patterns, storage, anti-patterns, and quick-reference for all SDK docs
11
12
  - **[AI & Chat Completions](ai.md)** - Chat completions, RAG (document-grounded Q&A), voice integration, streaming, tool calling, podcast generation
12
13
  - **[Widgets](widgets.md)** - Embeddable React components for parent applications
13
14
  - **[Containers](containers.md)** - Building full-app embeddable containers (lazy-loaded)
15
+ - **[Multi-Page App Architecture](mpa.md)** - Vite MPA build pipeline: public/admin entry points, widget/container/executor bundles, content-hashed CDN assets
14
16
  - **[App Configuration Files](app-manifest.md)** - `app.manifest.json` and `app.admin.json` reference — bundles, components, setup questions, import schemas, tunable fields, and metrics
15
17
  - **[Executor Model](executor.md)** - Programmatic JS bundles for AI-driven setup, server-side SEO metadata generation, and LLM content for AI crawlers
16
18
  - **[Realtime](realtime.md)** - Real-time data updates and WebSocket connections
@@ -23,7 +25,9 @@ For detailed guides on specific features:
23
25
  - **[App Data Storage](app-data-storage.md)** - User-specific and collection-scoped app data storage
24
26
  - **[App Objects: Cases, Threads & Records](app-objects.md)** - Generic app-scoped building blocks for support cases, discussions, bookings, registrations, and more
25
27
  - **[Communications](comms.md)** - Transactional sends, multi-channel broadcasts, consent management, push registration, and analytics
28
+ - **[Interactions & Event Tracking](interactions.md)** - Log user events, count outcomes, query history, and define interaction types with permissions
26
29
  - **[Deep Link Discovery](deep-link-discovery.md)** - Registering and discovering navigable app states for portal menus and AI orchestration
30
+ - **[AI-Native App Manifests](manifests.md)** - How AI workflows discover, configure, and import apps via structured manifests and prose guides
27
31
  - **[AI Guide Template](ai-guide-template.md)** - A sample for an app on how to build an AI setup guide
28
32
 
29
33
  ## API Namespaces
@@ -51,7 +55,7 @@ The Smartlinks SDK is organized into the following namespaces:
51
55
  - **segments** - Define dynamic/static audience segments; estimate and list recipients; schedule calculations.
52
56
 
53
57
  — Analytics & Events —
54
- - **interactions** - Log and analyze interactions/outcomes; aggregates and actor lists; interaction definition CRUD.
58
+ - **interactions** - Log and analyze interactions/outcomes; aggregates and actor lists; interaction definition CRUD. → [Guide](interactions.md)
55
59
 
56
60
  — Automation —
57
61
  - **journeys** - Configure automated flows triggered by events or schedules; steps, rules; full CRUD.
@@ -847,7 +851,11 @@ interface AppManifestFiles {
847
851
  umd: string;
848
852
  esm?: string;
849
853
  };
850
- css?: string;
854
+ * CSS file path — set to `null` (or omit) when the bundle ships no CSS.
855
+ * Most widgets and containers use Tailwind/shadcn classes from the parent and produce no CSS file.
856
+ * Only set to a non-null string if an actual CSS file exists in dist/;
857
+ * a non-null value pointing to a missing file will cause a 404 in the parent portal.
858
+ css?: string | null;
851
859
  }
852
860
  ```
853
861
 
@@ -4897,99 +4905,101 @@ interface SegmentRecipientsResponse {
4897
4905
  **Tag** (interface)
4898
4906
  ```typescript
4899
4907
  interface Tag {
4900
- id: string // UUID
4901
- orgId: string // Organization ID
4902
- tagId: string // Unique tag identifier (globally unique)
4903
- collectionId: string // Collection ID
4904
- productId?: string // Product ID (optional — may be a ref-only tag)
4905
- variantId?: string | null // Optional: Variant ID
4906
- batchId?: string | null // Optional: Batch ID
4907
- proofId?: string // Proof ID (serial number or explicit)
4908
- * Polymorphic reference type linking the tag to any app object, e.g.
4909
- * `'app_record'`, `'app_case'`, `'container'`, etc.
4910
- * Must always be paired with `refId`.
4911
- refType?: string
4912
- refId?: string
4913
- metadata: Record<string, any> // Additional metadata (e.g., serialIndex)
4914
- createdAt: string // ISO 8601 timestamp
4915
- updatedAt: string // ISO 8601 timestamp
4908
+ id: string // Internal UUID
4909
+ orgId: string // Organisation ID
4910
+ tagId: string // Physical tag identifier (NFC UID, QR code, etc.)
4911
+ collectionId: string // Owning collection
4912
+ productId: string | null // Linked product
4913
+ variantId: string | null // Product variant
4914
+ batchId: string | null // Production batch
4915
+ proofId: string | null // Proof / serial number
4916
+ * Polymorphic ref type: `'app_record'`, `'app_case'`, `'app_thread'`, `'container'`, etc.
4917
+ * Always paired with `refId`.
4918
+ refType: string | null
4919
+ refId: string | null
4920
+ metadata: Record<string, any>
4921
+ createdAt: string // ISO 8601
4922
+ updatedAt: string // ISO 8601
4923
+ }
4924
+ ```
4925
+
4926
+ **TagIndexEntry** (interface)
4927
+ ```typescript
4928
+ interface TagIndexEntry {
4929
+ tagId: string
4930
+ collectionId: string
4931
+ }
4932
+ ```
4933
+
4934
+ **TagEmbedded** (interface)
4935
+ ```typescript
4936
+ interface TagEmbedded {
4937
+ products?: Record<string, any>
4938
+ * `proofId → proof record or virtual serial-number proof`
4939
+ * (when `embed` includes `'proof'`)
4940
+ proofs?: Record<string, any>
4941
+ * `containerId → Container row`
4942
+ * (for tags where `refType === 'container'`, when `embed` includes `'container'`)
4943
+ containers?: Record<string, any>
4944
+ * `refId → app_record | app_case | app_thread | container`
4945
+ * (when `embed` includes `'ref'`)
4946
+ refs?: Record<string, any>
4916
4947
  }
4917
4948
  ```
4918
4949
 
4919
4950
  **CreateTagRequest** (interface)
4920
4951
  ```typescript
4921
4952
  interface CreateTagRequest {
4922
- tagId: string // Required: Unique tag identifier
4923
- productId?: string // Optional: Product ID (required when proofId is set without useSerialNumber)
4924
- variantId?: string // Optional: Variant ID
4925
- batchId?: string // Optional: Batch ID
4926
- proofId?: string // Optional: Explicit proof ID (if omitted with productId, auto-generates serial)
4927
- useSerialNumber?: boolean // Optional: Explicitly request serial number generation
4928
- * Polymorphic ref type linking this tag to any app object (e.g. `'app_record'`, `'container'`).
4929
- * Must be paired with `refId`. A tag can simultaneously have a product/proof AND a ref.
4930
- refType?: string
4931
- refId?: string
4932
- metadata?: Record<string, any> // Optional: Additional metadata
4933
- force?: boolean // Optional: Overwrite if tag exists in same collection (default: false)
4934
- }
4935
- ```
4936
-
4937
- **CreateTagsBatchRequest** (interface)
4938
- ```typescript
4939
- interface CreateTagsBatchRequest {
4940
- tags: Array<{
4941
- tagId: string // Required: Unique tag identifier
4942
- productId: string // Required: Product ID
4943
- variantId?: string // Optional: Variant ID
4944
- batchId?: string // Optional: Batch ID
4945
- proofId?: string // Optional: If omitted, auto-generates serial number
4946
- metadata?: Record<string, any> // Optional: Additional metadata
4947
- }>
4948
- force?: boolean // Optional: Overwrite existing tags in same collection (default: false)
4953
+ tagId: string // Required
4954
+ productId?: string
4955
+ variantId?: string
4956
+ batchId?: string
4957
+ proofId?: string // Required if productId set, unless useSerialNumber=true
4958
+ useSerialNumber?: boolean // Auto-generate a serial number as proofId
4959
+ refType?: string // Must be paired with refId
4960
+ refId?: string // Must be paired with refType
4961
+ metadata?: Record<string, any>
4962
+ force?: boolean // Overwrite if tag already exists in this collection
4949
4963
  }
4950
4964
  ```
4951
4965
 
4952
- **CreateTagsBatchResponse** (interface)
4966
+ **BatchCreateTagRequest** (interface)
4953
4967
  ```typescript
4954
- interface CreateTagsBatchResponse {
4955
- summary: {
4956
- total: number // Total tags in request
4957
- created: number // Successfully created
4958
- updated: number // Successfully updated (with force=true)
4959
- failed: number // Failed to create/update
4960
- conflicts: number // Already exist (without force=true)
4961
- }
4962
- results: {
4963
- created: Tag[] // Array of successfully created tags
4964
- updated: Tag[] // Array of successfully updated tags
4965
- failed: Array<{
4966
- tagId: string
4967
- reason: string // Error code (e.g., "TAG_ASSIGNED_ELSEWHERE", "CREATE_FAILED")
4968
- message: string // Human-readable error message
4969
- existingTag?: Tag // Existing tag if applicable
4970
- }>
4971
- conflicts: Array<{
4972
- tagId: string
4973
- reason: string // "TAG_ALREADY_ASSIGNED"
4974
- message: string
4975
- existingTag: Tag // The existing tag
4976
- }>
4977
- }
4968
+ interface BatchCreateTagRequest {
4969
+ tags: Omit<CreateTagRequest, 'force'>[]
4970
+ force?: boolean
4978
4971
  }
4979
4972
  ```
4980
4973
 
4981
4974
  **UpdateTagRequest** (interface)
4982
4975
  ```typescript
4983
4976
  interface UpdateTagRequest {
4984
- productId?: string // Optional: Update product ID
4985
- variantId?: string | null // Optional: Update variant ID (null to clear)
4986
- batchId?: string | null // Optional: Update batch ID (null to clear)
4987
- proofId?: string // Optional: Update proof ID
4988
- * Polymorphic ref type. Must be paired with `refId`.
4989
- * Set both to `null` / omit to leave unchanged.
4990
- refType?: string
4991
- refId?: string
4992
- metadata?: Record<string, any> // Optional: Merge with existing metadata
4977
+ productId?: string
4978
+ variantId?: string
4979
+ batchId?: string
4980
+ proofId?: string
4981
+ refType?: string | null
4982
+ refId?: string | null
4983
+ metadata?: Record<string, any> // Merged with existing metadata
4984
+ }
4985
+ ```
4986
+
4987
+ **BatchCreateResult** (interface)
4988
+ ```typescript
4989
+ interface BatchCreateResult {
4990
+ summary: {
4991
+ total: number
4992
+ created: number
4993
+ updated: number
4994
+ failed: number
4995
+ conflicts: number
4996
+ }
4997
+ results: {
4998
+ created: Tag[]
4999
+ updated: Tag[]
5000
+ failed: Array<{ tagId: string; reason: string; message: string }>
5001
+ conflicts: Array<{ tagId: string; reason: string; message: string; existingTag: Tag }>
5002
+ }
4993
5003
  }
4994
5004
  ```
4995
5005
 
@@ -5003,73 +5013,73 @@ interface DeleteTagResponse {
5003
5013
  **ListTagsRequest** (interface)
5004
5014
  ```typescript
5005
5015
  interface ListTagsRequest {
5006
- limit?: number // Optional: Max results (default: 100)
5007
- offset?: number // Optional: Pagination offset (default: 0)
5008
- productId?: string // Optional: Filter by product ID
5009
- variantId?: string // Optional: Filter by variant ID
5010
- batchId?: string // Optional: Filter by batch ID
5011
- refType?: string
5012
- refId?: string
5016
+ limit?: number
5017
+ offset?: number
5018
+ productId?: string
5019
+ variantId?: string
5020
+ batchId?: string
5021
+ refType?: string
5022
+ refId?: string
5013
5023
  }
5014
5024
  ```
5015
5025
 
5016
5026
  **ListTagsResponse** (interface)
5017
5027
  ```typescript
5018
5028
  interface ListTagsResponse {
5019
- tags: Tag[]
5020
- limit: number
5029
+ tags: Tag[]
5030
+ limit: number
5021
5031
  offset: number
5022
5032
  }
5023
5033
  ```
5024
5034
 
5025
- **PublicGetTagRequest** (interface)
5035
+ **LookupTagsRequest** (interface)
5026
5036
  ```typescript
5027
- interface PublicGetTagRequest {
5028
- embed?: string // Optional: Comma-separated values: "collection", "product", "proof"
5037
+ interface LookupTagsRequest {
5038
+ tagIds: string[]
5039
+ embed?: string
5029
5040
  }
5030
5041
  ```
5031
5042
 
5032
- **PublicGetTagResponse** (interface)
5043
+ **LookupTagsQueryRequest** (interface)
5033
5044
  ```typescript
5034
- interface PublicGetTagResponse {
5035
- tag: Tag
5036
- collection?: any // Included if embed contains "collection"
5037
- product?: any // Included if embed contains "product"
5038
- proof?: any // Included if embed contains "proof"
5045
+ interface LookupTagsQueryRequest {
5046
+ tagIds: string
5047
+ embed?: string
5039
5048
  }
5040
5049
  ```
5041
5050
 
5042
- **PublicBatchLookupRequest** (interface)
5051
+ **ByRefRequest** (interface)
5043
5052
  ```typescript
5044
- interface PublicBatchLookupRequest {
5045
- tagIds: string[] // Array of tag IDs to lookup
5046
- embed?: string // Optional: Comma-separated: "collection", "product", "proof"
5053
+ interface ByRefRequest {
5054
+ refType: string
5055
+ refId: string
5056
+ embed?: string
5047
5057
  }
5048
5058
  ```
5049
5059
 
5050
- **PublicBatchLookupResponse** (interface)
5060
+ **ReverseTagLookupParams** (interface)
5051
5061
  ```typescript
5052
- interface PublicBatchLookupResponse {
5053
- tags: Record<string, Tag> // Map: tagId → Tag object
5054
- collections?: Record<string, any> // Map: collectionId → Collection (if embed=collection)
5055
- products?: Record<string, any> // Map: productId → Product (if embed=product)
5056
- proofs?: Record<string, any> // Map: proofId → Proof (if embed=proof)
5062
+ interface ReverseTagLookupParams {
5063
+ refType: string
5064
+ refId: string
5065
+ embed?: string
5057
5066
  }
5058
5067
  ```
5059
5068
 
5060
- **PublicBatchLookupQueryRequest** (interface)
5069
+ **PublicGetTagResponse** (interface)
5061
5070
  ```typescript
5062
- interface PublicBatchLookupQueryRequest {
5063
- tagIds: string // Comma-separated tag IDs
5064
- embed?: string // Optional: Comma-separated: "collection", "product", "proof"
5071
+ interface PublicGetTagResponse {
5072
+ tag: Tag
5073
+ embedded: TagEmbedded
5065
5074
  }
5066
5075
  ```
5067
5076
 
5068
- **ReverseTagLookupParams** (interface)
5077
+ **TagLookupResponse** (interface)
5069
5078
  ```typescript
5070
- interface ReverseTagLookupParams {
5071
- refType: string
5072
- refId: string
5079
+ interface TagLookupResponse {
5080
+ count: number
5081
+ tags: Tag[]
5082
+ embedded: TagEmbedded
5073
5083
  }
5074
5084
  ```
5075
5085
 
@@ -5080,6 +5090,14 @@ interface ReverseTagLookupResponse {
5080
5090
  }
5081
5091
  ```
5082
5092
 
5093
+ **ByRefResponse** (interface)
5094
+ ```typescript
5095
+ interface ByRefResponse {
5096
+ tags: Tag[]
5097
+ embedded: TagEmbedded
5098
+ }
5099
+ ```
5100
+
5083
5101
  ### template
5084
5102
 
5085
5103
  **TemplateBase** (interface)
@@ -6533,55 +6551,56 @@ Get aggregate statistics for records POST /records/aggregate
6533
6551
 
6534
6552
  **create**(collectionId: string,
6535
6553
  data: CreateTagRequest) → `Promise<CreateTagResponse>`
6536
- Create a single tag mapping. If proofId is not provided, automatically generates a serial number. ```typescript // Auto-generate serial number const tag = await tags.create('coll_123', { tagId: 'TAG001', productId: 'prod_456', variantId: 'var_789' }) // Use explicit proof ID const tag2 = await tags.create('coll_123', { tagId: 'TAG002', productId: 'prod_456', proofId: 'proof_explicit_123' }) ```
6554
+ Create a single tag mapping (admin). If `productId` is set without `proofId`, a serial number is auto-generated unless `useSerialNumber: true` is explicitly passed. `refType` and `refId` can be set independently of or alongside product/proof. ```typescript // Auto-generate serial number const tag = await tags.create('coll_123', { tagId: 'NFC-001', productId: 'prod_456', batchId: 'batch_2026_01', }) // Explicit proof + polymorphic ref const tag2 = await tags.create('coll_123', { tagId: 'NFC-002', refType: 'container', refId: 'container-uuid', }) ```
6537
6555
 
6538
6556
  **createBatch**(collectionId: string,
6539
- data: CreateTagsBatchRequest) → `Promise<CreateTagsBatchResponse>`
6540
- Create multiple tag mappings efficiently in a batch operation. By default, auto-generates serial numbers for all tags without explicit proofId. Tags are grouped by product/variant/batch and serial numbers are generated in a single transaction per group for optimal performance. ```typescript const result = await tags.createBatch('coll_123', { tags: [ { tagId: 'TAG001', productId: 'prod_456', variantId: 'var_789' }, { tagId: 'TAG002', productId: 'prod_456', variantId: 'var_789' }, { tagId: 'TAG003', productId: 'prod_456', batchId: 'batch_100' } ] }) console.log(`Created: ${result.summary.created}, Failed: ${result.summary.failed}`) ```
6557
+ data: BatchCreateTagRequest) → `Promise<BatchCreateResult>`
6558
+ Batch-create tags (admin). Tags with `productId` but no `proofId` automatically get serial numbers. Serial number generation is grouped by `(productId, variantId, batchId)` for efficiency. Partial success is possible — check `results` for individual outcomes. ```typescript const result = await tags.createBatch('coll_123', { tags: [ { tagId: 'NFC-001', productId: 'prod_456', batchId: 'batch_2026_01' }, { tagId: 'NFC-002', productId: 'prod_456', batchId: 'batch_2026_01' }, ], }) console.log(`Created: ${result.summary.created}, Conflicts: ${result.summary.conflicts}`) ```
6559
+
6560
+ **get**(collectionId: string,
6561
+ tagId: string) → `Promise<GetTagResponse>`
6562
+ Get a single tag by `tagId` (admin).
6541
6563
 
6542
6564
  **update**(collectionId: string,
6543
6565
  tagId: string,
6544
6566
  data: UpdateTagRequest) → `Promise<UpdateTagResponse>`
6545
- Update an existing tag mapping. ```typescript const updated = await tags.update('coll_123', 'TAG001', { variantId: 'var_999', metadata: { notes: 'Updated variant' } }) ```
6567
+ Update a tag (admin). Partial update — only provided fields are changed. `metadata` is deep-merged with the existing value. Pass `refType: null, refId: null` to clear the polymorphic ref. ```typescript const updated = await tags.update('coll_123', 'NFC-001', { variantId: 'var_premium', metadata: { notes: 'Updated to premium variant' }, }) // Clear polymorphic ref await tags.update('coll_123', 'NFC-001', { refType: null, refId: null }) ```
6546
6568
 
6547
6569
  **remove**(collectionId: string,
6548
6570
  tagId: string) → `Promise<DeleteTagResponse>`
6549
- Delete a tag mapping. ```typescript await tags.remove('coll_123', 'TAG001') ```
6550
-
6551
- **get**(collectionId: string,
6552
- tagId: string) → `Promise<GetTagResponse>`
6553
- Get a single tag mapping by tagId. ```typescript const tag = await tags.get('coll_123', 'TAG001') ```
6571
+ Delete a tag (admin). Permanently removes the tag from the per-org shard and the shared index.
6554
6572
 
6555
6573
  **list**(collectionId: string,
6556
6574
  params?: ListTagsRequest) → `Promise<ListTagsResponse>`
6557
- List all tags for a collection with optional filters and pagination. ```typescript // List all tags const all = await tags.list('coll_123') // List with filters const filtered = await tags.list('coll_123', { productId: 'prod_456', variantId: 'var_789', limit: 50, offset: 0 }) ```
6575
+ List tags with optional filters and pagination (admin). ```typescript // All tags for a product const { tags: list } = await tags.list('coll_123', { productId: 'prod_456' }) // All tags linked to a container const { tags: linked } = await tags.list('coll_123', { refType: 'container', refId: 'container-uuid', }) ```
6558
6576
 
6559
6577
  **byRef**(collectionId: string,
6560
6578
  params: ReverseTagLookupParams) → `Promise<ReverseTagLookupResponse>`
6561
- Reverse lookup find all tags linked to a given app object (admin). Uses a global cross-shard index keyed on `(orgId, refType, refId)`, so it is safe to call without knowing which collection the object belongs to. ```typescript const { tags: linked } = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', }) ```
6579
+ Reverse lookup — find all tags linked to a given object (admin). Uses a compound index on `(orgId, refType, refId)` on the per-org shard. No embed support on the admin side. ```typescript const { tags: linked } = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', }) ```
6562
6580
 
6563
- **getTag**(tagId: string,
6564
- params?: PublicGetTagRequest) `Promise<PublicGetTagResponse>`
6565
- Public lookup of a single tag by tagId (global). Optionally embed related collection, product, or proof data. No authentication required. ```typescript // Simple lookup const result = await tags.getTag('TAG001') // With embedded data const withData = await tags.getTag('TAG001', { embed: 'collection,product,proof' }) console.log(withData.tag, withData.collection, withData.product, withData.proof) ```
6581
+ **resolveTag**(tagId: string) → `Promise<TagIndexEntry>`
6582
+ Global tag resolve — returns `{ tagId, collectionId }` only. Use this **only** when you have a raw `tagId` and do not yet know which collection it belongs to. Queries the shared `tag_index` shard. Once `collectionId` is resolved, call `publicGetByCollection` for full data. > The global `/public/tags/by-ref` endpoint has been removed. > Use the collection-scoped `publicByRef` instead. ```typescript // Step 1: resolve collection const { collectionId } = await tags.resolveTag('NFC-001') // Step 2: full lookup with embedded data const { tag, embedded } = await tags.publicGetByCollection( collectionId, 'NFC-001', 'product,proof' ) ```
6566
6583
 
6567
- **publicGet**(_collectionId: string,
6584
+ **publicGetByCollection**(collectionId: string,
6568
6585
  tagId: string,
6569
- params?: PublicGetTagRequest) → `Promise<PublicGetTagResponse>`
6570
- Backward-compat: Public lookup with collectionId parameter (ignored). Calls global route under /public/tags/:tagId.
6586
+ embed?: string) → `Promise<PublicGetTagResponse>`
6587
+ Single tag lookup with optional embedded data (public). `GET /public/collection/:collectionId/tags/:tagId?embed=product,proof,container,ref` Supported `embed` values: `'product'`, `'proof'`, `'container'`, `'ref'` (`'collection'` is not supported — the collection is already known from the URL). ```typescript const { tag, embedded } = await tags.publicGetByCollection( 'coll_123', 'NFC-001', 'product,proof' ) const product = embedded.products?.[tag.productId!] const proof = embedded.proofs?.[tag.proofId!] ```
6571
6588
 
6572
- **lookupTags**(data: PublicBatchLookupRequest) → `Promise<PublicBatchLookupResponse>`
6573
- Public batch lookup of multiple tags in a single request (POST). Only returns tags from the specified collection. Optionally embed related data. Related data is deduplicated and batch-fetched. No authentication required. ```typescript const result = await tags.publicBatchLookup('coll_123', { tagIds: ['TAG001', 'TAG002', 'TAG003'], embed: 'collection,product' }) // Access tags and deduplicated collections/products console.log(result.tags['TAG001']) console.log(result.collections) console.log(result.products) ```
6589
+ **lookupTags**(collectionId: string,
6590
+ data: LookupTagsRequest) `Promise<TagLookupResponse>`
6591
+ Batch tag lookup via POST (public). `POST /public/collection/:collectionId/tags/lookup` Tags not belonging to this collection are filtered out silently. Returns deduplicated embedded objects alongside the tag array. ```typescript const { count, tags: list, embedded } = await tags.lookupTags('coll_123', { tagIds: ['NFC-001', 'NFC-002', 'NFC-003'], embed: 'product,proof', }) ```
6574
6592
 
6575
- **publicBatchLookup**(_collectionId: string,
6576
- data: PublicBatchLookupRequest) → `Promise<PublicBatchLookupResponse>`
6577
- Backward-compat: Public batch lookup with collectionId parameter (ignored). Calls global route under /public/tags/lookup.
6593
+ **lookupTagsQuery**(collectionId: string,
6594
+ params: LookupTagsQueryRequest) → `Promise<TagLookupResponse>`
6595
+ Batch tag lookup via GET (public). `GET /public/collection/:collectionId/tags/lookup?tagIds=NFC-001,NFC-002&embed=product`
6578
6596
 
6579
- **lookupTagsQuery**(params: PublicBatchLookupQueryRequest) → `Promise<PublicBatchLookupQueryResponse>`
6580
- Public batch lookup of multiple tags using query parameters (GET). Only returns tags from the specified collection. Alternative to publicBatchLookup for simple GET requests. No authentication required. ```typescript const result = await tags.publicBatchLookupQuery('coll_123', { tagIds: 'TAG001,TAG002,TAG003', embed: 'collection' }) ```
6597
+ **publicByRef**(collectionId: string,
6598
+ params: ReverseTagLookupParams) `Promise<ByRefResponse>`
6599
+ Reverse lookup by ref via GET (public). `GET /public/collection/:collectionId/tags/by-ref?refType=container&refId=<uuid>&embed=ref` ```typescript const { tags: linked, embedded } = await tags.publicByRef('coll_123', { refType: 'container', refId: 'container-uuid', embed: 'container', }) const container = embedded.containers?.[containerId] ```
6581
6600
 
6582
- **publicBatchLookupQuery**(_collectionId: string,
6583
- params: PublicBatchLookupQueryRequest) → `Promise<PublicBatchLookupQueryResponse>`
6584
- Backward-compat: Public batch lookup (GET) with collectionId parameter (ignored). Calls global route under /public/tags/lookup.
6601
+ **publicByRefPost**(collectionId: string,
6602
+ data: ByRefRequest) → `Promise<ByRefResponse>`
6603
+ Reverse lookup by ref via POST (public). `POST /public/collection/:collectionId/tags/by-ref`
6585
6604
 
6586
6605
  ### template
6587
6606