Static Method

RelationIM.getRelationToken (acquire a unifiedAuthToken)

RelationIM.getRelationToken(addressAuthToken, APIKEY)

Config options

Description

Default

addressAuthToken: string

Required field. The token is acquired via authByMetamask.

apiKey: string

Required field. It is acquired from the Admin.

Note: In the return message, token refers to the account's unifiedAuthToken in relation. If there is no such account, one will be registered by default.

RelationIM.init(You need to initialize an API before calling it.)

RelationIM.init({configOptions})

Config options

Description

Default

token: string

Required. The unifiedAuthToken of a user

apiKey: string

Required. Acquired from the Admin.

connect: boolean

Optional. Whether to establish a socket connection to receive message.

false

refresh: boolean

Optional. Whether to initialize the interface again(refresh it).

false

Note: When using init to initialize the interface, you can use connect to specify whether to connect to socket. The parameter refresh means whether to refresh the RelationIM instance.

RelationIM.getInstance(to acquire the RelationIM instance already initialized.)

RelationIM.getInstance()

Note: Normally you only need one RelationIM instance. However, you may frequently call common APIs. To avoid redunant initiations of RelationIM and socket , we suggest you manually specify a static method RelationIM.getInstancewhere needed so that you can acquire theRelationIM` instance already initialized.

Last updated