Home Manual Reference Source
import {SmartClient} from 'zetapush-js/src/client/smart.js'
public class | source

SmartClient

Extends:

Client → SmartClient

Example:

// Create a new WeakClient
const client = new ZetaPush.SmartClient({
  sandboxId: '<YOUR-SANDBOX-ID>'
})

Constructor Summary

Public Constructor
public

Create a new ZetaPush SmartClient

Method Summary

Public Methods
public

Disconnect client from ZetaPush backend

public
public
public
public
public
public

setCredentials(parameters: {login: string, password: string})

Inherited Summary

From class Client
public

Add a connection listener to handle life cycle connection events

public

Safely connect client to ZetaPush

public

createAsyncMacroService(parameters: {listener: Object, Type: class, deploymentId: string}): Object

Create a promise based service instance

public

createService(parameters: {listener: Object, Type: class, deploymentId: string}): Object

Create a publish/subscribe for a service type

public

Disonnect client from ZetaPush

public

Get the client resource

public

Get the client sandbox id

public

Get server urls list

public

Get the client user id

public
public

Is client connected to ZetaPush

public

Remove a connection status listener

public

setAuthentication(authentication: function(): AbstractHandshake)

Set a new authentication methods

public

Set logging level Valid values are the strings 'error', 'warn', 'info' and 'debug', from less verbose to more verbose.

public

setResource(resource: string)

Set new client resource value

public

unsubscribe(service: Object): *

Remove all subscriptions

Public Constructors

public constructor(config: SmartClientConfig) source

Create a new ZetaPush SmartClient

Override:

Client#constructor

Params:

NameTypeAttributeDescription
config SmartClientConfig

Public Methods

public disconnect() source

Disconnect client from ZetaPush backend

Override:

Client#disconnect

public getCredentials(): Object source

Return:

Object

public getSession(): Object source

Return:

Object

public hasCredentials(): boolean source

Return:

boolean

public isStronglyAuthenticated(session: *): boolean source

Params:

NameTypeAttributeDescription
session *
  • optional

Return:

boolean

public isWeaklyAuthenticated(session: *): boolean source

Params:

NameTypeAttributeDescription
session *
  • optional

Return:

boolean

public setCredentials(parameters: {login: string, password: string}) source

Params:

NameTypeAttributeDescription
parameters {login: string, password: string}