SDK Reference

    @proveanything/smartlinks

    npm install @proveanything/smartlinks
    View on npm →

    Namespaces

    Core Data & Configuration

    product

    Create and manage products within a collection; metadata, tags, media.

    16 functions16 types

    createClaimWindow

    public
    createClaimWindow(collectionId: string,
        productId: string,
        body: Record<string, JsonValue>) → Promise<unknown>

    updateClaimWindow

    public
    updateClaimWindow(collectionId: string,
        productId: string,
        claimId: string,
        body: Record<string, JsonValue>) → Promise<unknown>

    refresh

    public
    refresh(collectionId: string,
        productId: string) → Promise<>

    getSN

    Get serial numbers for a product (admin only).

    public
    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).

    public
    lookupSN(collectionId: string,
        productId: string,
        codeId: string) → Promise<unknown>

    publicLookupClaim

    public
    publicLookupClaim(collectionId: string,
        productId: string,
        claimId: string) → Promise<unknown>

    publicCreateClaim

    public
    publicCreateClaim(collectionId: string,
        productId: string,
        body: ) → Promise<unknown>

    get

    Retrieves a single Product Item by Collection ID and Product ID.

    admin
    get(collectionId: string,
        productId: string,
        admin?: boolean) → Promise<>

    list

    List all Product Items for a Collection.

    admin
    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: {} });

    public
    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! });

    public
    update(collectionId: string,
        productId: string,
        data: ) → Promise<>

    remove

    Delete a product for a collection (admin only).

    public
    remove(collectionId: string,
        productId: string) → Promise<void>

    find

    public
    find(collectionId: string,
        body: ) → Promise<>

    publicFind

    public
    publicFind(collectionId: string,
        params?: ProductPublicFindParams) → Promise<[]>

    clone

    public
    clone(collectionId: string,
        productId: string,
        body: Record<string, JsonValue> = {}) → Promise<>

    listAssets

    admin
    listAssets(collectionId: string,
        productId: string,
        admin?: boolean) → Promise<unknown>