Home Reference Source
public class | source

Container

Extends:

BaseContainer → Container

Container provides configuration for connecting to Skygear server, and accessors to other containers, providing various functionalities:

  • skygear.auth - AuthContainer: User authentications and user roles API.
  • skygear.relation - RelationContainer: User relation API, like add and query Friends.
  • skygear.privateDB - Database: Private database of the current user, with record API, like query, save and delete.
  • skygear.publicDB - PublicDatabase: Public database, providing the same record API as Database, but with additional record role API.
  • skygear.pubsub - PubsubContainer: A publish-subscribe interface, providing real-time message-based communication with other users.
  • skygear.push - PushContainer: Push Notifications.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public get
public get
public get
public get
public get
public get
public

timeoutOptions: Object

Options for how much time to wait for client request to complete.

Method Summary

Public Methods
public

async config(options: Object): Promise<Container>

Sets a new end point and new API key to the container.

Inherited Summary

From class BaseContainer
public static get

VERSION: String

The version of Skygear.

public get

ACL: ACL

public get
public get
public get
public get
public get
public get
public get
public get
public get
public get
public get
public get
public get
public get
public get
public get
public get
public get
public get
public get

VERSION: String

The version of Skygear.

public get

endPoint: String

Endpoint of the skygear container

public set

endPoint: String

Endpoint of the skygear container

public

apiKey: String

API key of the skygear container

public

async clearCache(): Promise

Clears all cache in skygear container store.

public

async config(options: Object): Promise<BaseContainer>

Sets a new end point and new API key to the container.

public

configApiKey(apiKey: String)

Sets a new API key to the container.

public

configEndPoint(endPoint: String)

Sets a new end point to the container.

public

async lambda(name: String, data: Object): Promise<Object>

Calls a registered lambda function without arguments.

Public Constructors

public constructor() source

Override:

BaseContainer#constructor

Public Members

public get auth: AuthContainer source

public get privateDB: Database source

public get publicDB: PublicDatabase source

public get pubsub: PubsubContainer source

public get push: PushContainer source

public get relation: RelationContainer source

public timeoutOptions: Object source

Options for how much time to wait for client request to complete.

Properties:

NameTypeAttributeDescription
timeoutOptions.deadline number
  • optional

deadline for the request and response to complete (in milliseconds)

timeoutOptions.response number
  • optional
  • default: 60000

maximum time to wait for an response (in milliseconds)

See:

Public Methods

public async config(options: Object): Promise<Container> source

Sets a new end point and new API key to the container.

After configuration,

  • it tries to restore the user, access token and device id, and,
  • the pubsub client connects to skygear server if a user is restored.

Override:

BaseContainer#config

Params:

NameTypeAttributeDescription
options Object

configuration options of the skygear container

options.apiKey String

api key

options.endPoint String

end point

Return:

Promise<Container>

promise with the skygear container