SDK Reference

    @proveanything/smartlinks

    npm install @proveanything/smartlinks
    View on npm →

    Namespaces

    Core Data & Configuration

    crate

    Organize products in containers/crates for logistics and grouping.

    5 functions7 types

    list

    List crates for a collection with pagination support. Returns crates in pages, with support for soft-deleted crates. typescript // Get first page const page1 = await crate.list('coll_123', { limit: 100 }) console.log(`Found ${page1.items.length} crates`) // Get next page if (page1.hasMore) { const page2 = await crate.list('coll_123', { limit: 100, startAfter: page1.lastId }) } // Include soft-deleted crates const withDeleted = await crate.list('coll_123', { includeDeleted: true })

    public
    list(collectionId: string,
        params?: ) → Promise<>

    get

    Get a single crate by ID for a collection (admin only). typescript const crate = await crate.get('coll_123', 'crate_abc123') console.log(`Crate has ${crate.items?.length ?? 0} items`)

    public
    get(collectionId: string,
        crateId: string) → Promise<GetCrateResponse>

    create

    Create a new crate for a collection (admin only). typescript const newCrate = await crate.create('coll_123', { items: [ { id: 'tag_001', codeId: 'ABC123', productId: 'prod_1', productName: 'Product Name' } ] }) console.log(`Created crate ${newCrate.id}`)

    public
    create(collectionId: string,
        data: ) → Promise<CreateCrateResponse>

    update

    Update a crate for a collection (admin only). typescript const updated = await crate.update('coll_123', 'crate_abc123', { items: [ { id: 'tag_002', codeId: 'XYZ789', productId: 'prod_2' } ] })

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

    remove

    Delete a crate for a collection (admin only). This performs a soft delete. typescript await crate.remove('coll_123', 'crate_abc123')

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