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

WeakClient

Extends:

Client → WeakClient

Example:

// Create a new WeakClient
const client = new ZetaPush.WeakClient({
  sandboxId: '<YOUR-SANDBOX-ID>'
})
// Explicit deploymentId
// WeakClient provide optional deployment id, according to the following convention `${ServiceType.toLowerCase()_0}`
// deploymentId default value is weak_0
const client = new ZetaPush.WeakClient({
  deploymentId: 'weak_0',
  sandboxId: '<YOUR-SANDBOX-ID>'
})

Constructor Summary

Public Constructor
public

Create a new ZetaPush WeakClient

Method Summary

Public Methods
public

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: WeakClientConfig) source

Create a new ZetaPush WeakClient

Override:

Client#constructor

Params:

NameTypeAttributeDescription
config WeakClientConfig

Public Methods

public getToken(): string source

Return:

string

The stored token