Access to the collections API
BetafilesAccess to the files/blob storage API
BetamonetizationAccess to the monetization API
Access to the organizations API
Access to the permissions API
Access to the social API
Context of the app's own DB, owned by the app's team (ID = app ID).
Gets a collection interface (API access to the specified collection)
The name of the collection to create the interface for.
OptionalcollectionOptions: CollectionOptionsAn optional object for specifying an onCreate hook. The onCreate hook sets up a collection when it is created (e.g., to set up permissions)
Gets a context: the same APIs on another owner's database. It shares its server's connection, so contexts are cheap.
Checks if the user is logged in. i.e. if an access token is in local storage.
Opens a pop-up window to perform OAuth login.
Will fallback to redirect login if pop-up fails to open, if options.type is not popup (meaning an app has explicitly opted out of falling back to redirect login)
Settles when the login finished or the user closed the pop-up: check isLoggedIn.
Optionaloptions: { type?: LoginType }Logs out a user. Deletes the access token from local storage and reloads the page.
Sets a callback function an app can run when it connects or re-connects to the API.
Sets a callback function an app can run when the server refuses the user.
e.g. Invalid access token. Network and server failures don't count: the connection keeps trying, and restores subscriptions once it's back.
Sets a callback function an app can run when a user has successfully logged in.
e.g. Set state, redirect, etc.
Sets a callback function an app can run a login error occurs.
e.g. Authorization code is invalid
The primary class of the Bazaar JS SDK to help you more easily build web apps with Bazaar.