Class BazaarContext

The primary class of the Bazaar JS SDK to help you more easily build web apps with Bazaar.

Constructors

Properties

Methods

Constructors

  • Parameters

    • options: APIOptions
    • onConnect: (() => Promise<void>)
        • (): Promise<void>
        • Returns Promise<void>

    • onConnectError: ((message) => Promise<void>)
        • (message): Promise<void>
        • Parameters

          • message: string

          Returns Promise<void>

    Returns BazaarContext

Properties

api: API
collections: CollectionsAPI

Access to the collections API

permissions: PermissionsAPI

Access to the permissions API

Methods

  • Gets a collection interface (API access to the specified collection)

    Type Parameters

    Parameters

    • collectionName: string

      The name of the collection to create the interface for.

    • Optional collectionOptions: CollectionOptions

      An optional object for specifying an onCreate hook. The onCreate hook sets up a collection when it is created (e.g., to set up permissions)

    Returns CollectionAPI<T>