SDK Reference

    @proveanything/smartlinks

    npm install @proveanything/smartlinks
    View on npm →

    Namespaces

    Core Data & Configuration

    collection

    Manage collections, settings, and identifiers for your workspace.

    12 functions6 types

    get

    Retrieves a single Collection by its ID.

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

    list

    Retrieves all Collections.

    admin
    list(admin?: boolean) → Promise<[]>

    getShortId

    Retrieve a collection by its shortId (public endpoint).

    public
    getShortId(shortId: string) → Promise<>

    getSettings

    Retrieve a specific settings group for a collection. Public reads return the public view of the settings group. If the stored payload contains a top-level admin object, that block is omitted from public responses and included when admin === true.

    admin
    getSettings(collectionId: string, settingGroup: string, admin?: boolean) → Promise<any>

    getAppsConfig

    Retrieve all configured app module definitions for a collection (public endpoint).

    public
    getAppsConfig(collectionId: string) → Promise<>

    updateSettings

    Update a specific settings group for a collection (admin endpoint). This writes through the admin endpoint, but root-level fields are still part of the public settings payload. Put confidential values under settings.admin if they should only be returned on admin reads.

    public
    updateSettings(collectionId: string, settingGroup: string, settings: any) → Promise<any>

    create

    Create a new collection (admin only).

    public
    create(data: ) → Promise<>

    update

    Update a collection (admin only).

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

    remove

    Delete a collection (admin only).

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

    getSN

    Get serial numbers for a collection (admin only).

    public
    getSN(collectionId: string,
        startIndex: number = 0,
        count: number = 10) → Promise<any>

    lookupSN

    Look up a serial number by code for a collection (admin only).

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

    assignSN

    Assign a value to a serial number for a collection (admin only).

    public
    assignSN(collectionId: string,
        codeId: string,
        value: any) → Promise<any>