How to use backendless-rt-client - 3 common examples

To help you get started, we’ve selected a few backendless-rt-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Backendless / JS-SDK / src / rt.js View on Github external
import BackendlessRTClient from 'backendless-rt-client'

import Utils from './utils'
import LocalVars from './local-vars'
import { getCurrentUserToken } from './users/current-user'

let rtClient = null
const rtClientId = Utils.uuid()

export const RTListeners = BackendlessRTClient.Listeners
export const RTScopeConnector = BackendlessRTClient.ScopeConnector

export const RTClient = {

  get subscriptions() {
    return rtClient.subscriptions
  },

  get methods() {
    return rtClient.methods
  }
}

export const checkUsesInBusinessLogic = target => {
  if (LocalVars.ServerCode) {
    // temporarily disable this limitation
github Backendless / JS-SDK / src / rt.js View on Github external
import BackendlessRTClient from 'backendless-rt-client'

import Utils from './utils'
import LocalVars from './local-vars'
import { getCurrentUserToken } from './users/current-user'

let rtClient = null
const rtClientId = Utils.uuid()

export const RTListeners = BackendlessRTClient.Listeners
export const RTScopeConnector = BackendlessRTClient.ScopeConnector

export const RTClient = {

  get subscriptions() {
    return rtClient.subscriptions
  },

  get methods() {
    return rtClient.methods
  }
}

export const checkUsesInBusinessLogic = target => {
  if (LocalVars.ServerCode) {
    // temporarily disable this limitation
    // throw new Error(`"${target}" is not supported inside Business Logic.`)
github Backendless / JS-SDK / src / rt.js View on Github external
export const initRTClient = () => {
  if (rtClient) {
    rtClient.terminate()
  }

  rtClient = new BackendlessRTClient({
    appId     : LocalVars.applicationId,
    lookupPath: `${LocalVars.appPath}/rt/lookup`,
    debugMode : LocalVars.debugMode,
    connectQuery() {
      return {
        apiKey   : LocalVars.secretKey,
        userToken: getCurrentUserToken(),
        clientId : rtClientId,
      }
    }
  })
}

backendless-rt-client

Backendless RT Client for connect to Backendless RT Server

ISC
Latest version published 2 months ago

Package Health Score

68 / 100
Full package analysis