SDK Reference
@proveanything/smartlinks
Namespaces
product
Create and manage products within a collection; metadata, tags, media.
createClaimWindow
createClaimWindow(collectionId: string,
productId: string,
body: Record<string, JsonValue>) → Promise<unknown>updateClaimWindow
updateClaimWindow(collectionId: string,
productId: string,
claimId: string,
body: Record<string, JsonValue>) → Promise<unknown>refresh
refresh(collectionId: string,
productId: string) → Promise<>getSN
Get serial numbers for a product (admin only).
getSN(collectionId: string,
productId: string,
startIndex: number = 0,
count: number = 10) → Promise<unknown>lookupSN
Look up a serial number by code for a product (admin only).
lookupSN(collectionId: string,
productId: string,
codeId: string) → Promise<unknown>publicLookupClaim
publicLookupClaim(collectionId: string,
productId: string,
claimId: string) → Promise<unknown>publicCreateClaim
publicCreateClaim(collectionId: string,
productId: string,
body: ) → Promise<unknown>get
Retrieves a single Product Item by Collection ID and Product ID.
get(collectionId: string,
productId: string,
admin?: boolean) → Promise<>list
List all Product Items for a Collection.
list(collectionId: string,
admin?: boolean) → Promise<[]>create
Create a new product for a collection (admin only). The data payload follows the same shape as ProductResponse minus id and collectionId. Hero Image Auto-Fetch: You can pass heroImage as either: - A full asset object: { url: '...', thumbnails: {...} } - A string URL: The system automatically fetches and stores the image typescript // Using a URL - auto-fetched and stored const product = await product.create(collectionId, { name: 'Wine Bottle', description: 'Premium red wine', heroImage: 'https://example.com/wine.jpg', // Auto-fetched! data: {} });
create(collectionId: string,
data: ) → Promise<>update
Update a product for a collection (admin only). The data payload is a partial of ProductResponse minus id and collectionId. Hero Image Auto-Fetch: You can pass heroImage as either: - A full asset object: { url: '...', thumbnails: {...} } - A string URL: The system automatically fetches and stores the image typescript // Update with new URL - auto-fetched and stored const product = await product.update(collectionId, productId, { heroImage: 'https://example.com/new-wine.jpg' // Auto-fetched! });
update(collectionId: string,
productId: string,
data: ) → Promise<>remove
Delete a product for a collection (admin only).
remove(collectionId: string,
productId: string) → Promise<void>find
find(collectionId: string,
body: ) → Promise<>publicFind
publicFind(collectionId: string,
params?: ProductPublicFindParams) → Promise<[]>clone
clone(collectionId: string,
productId: string,
body: Record<string, JsonValue> = {}) → Promise<>listAssets
listAssets(collectionId: string,
productId: string,
admin?: boolean) → Promise<unknown>