Skip to content

Environmental Variables

Jonas Gossens edited this page Aug 15, 2019 · 16 revisions

These variables represent the current chayns environment. I.e. you can access the user, tapp, site or even the users device.
The specific properties should be self-explaining. If you still got any questions referring to one of this properties don't hesitate to ask a question.

Table of Contents

Returns an object that contains information about the user. The data is available after chayns is ready. Make sure to use 'chayns.ready'.

Properties

  • tobitAccessToken : string
  • facebookAccessToken : string
  • facebookId : string
  • id : int
  • name : string
  • firstName : string
  • lastName : string
  • personId : string
  • isAuthenticated : boolean
  • groups : object[]
  • adminMode : boolean

Returns an object that contains information about the current tapp. The data is available after chayns is ready. Make sure to use 'chayns.ready'.

Properties

  • customUrl : string
  • id : int
  • internalName : string
  • isExclusiveView : boolean
  • isHiddenFromMenu : boolean
  • isSubTapp : boolean
  • showName : string
  • sortId : int
  • parent : parent //see chayns.env.site.tapp.parent
  • userGroupIds : array

Returns an object that contains information about the parent tapp. The data is available after chayns is ready. Make sure to use 'chayns.ready'.

Properties

  • id: int

Returns an object that contains information about the site. The data is available after chayns is ready. Make sure to use 'chayns.ready'.

Properties

  • color : string
  • colorMode : int
  • colorScheme : int
  • domain : string
  • facebookAppId : string
  • facebookPageId : int
  • id : string
  • isAdEnabled : boolean
  • isArEnabled : boolean
  • locationId : int
  • locationPersonId : string
  • tapp : tapp //see chayns.env.site.tapp
  • tapps : tapp[]
  • title : string
  • url : string
  • version : string
  • environment : string

Returns an object that contains information about the current app. Here you can specify if your app is running on a dface device ( See on your chayns site: Settings/Equipment/Devices )

  • flavor : string //specifies if the current device is a dface device -> flavor='dface'.
  • fontScale : int
  • languageId : int
  • model: string
  • name : string
  • version : string
  • uid : string

Returns an object that contains information about the device. The data is only available on chayns apps after chayns is ready. Make sure to use 'chayns.ready'.

Properties

  • languageId : int
  • imei : string
  • systemName : string
  • model : string
  • uid : string
  • minLogLevel: int
  • dFaceVersion: int
  • deviceAccessToken: string

Returns an object that contains information about the browser. The data is only available after chayns is ready. Make sure to use 'chayns.ready'.

Properties

  • name : string
  • version : string
  • supportsWebP : bool

Returns the parameters that were appended to the chayns environment. This returns an object containing different parameters of the chayns site and those you set manually.

It is possbile to set chayns parameters by simply applying the value to a new chayns.env.parameters-property.

chayns.dialog.alert('Parameters', JSON.stringify(chayns.env.parameters));

This is a collection of funtions that will help you to identify the current system the tapp is running on.

The following lists showing you the properties that are currently available, grouped by data type.

Boolean:

  • chayns.env.isBrowser
  • chayns.env.isChaynsWeb
  • chayns.env.isChaynsWebDesktop
  • chayns.env.isChaynsWebLight
  • chayns.env.isChaynsWebMobile
  • chayns.env.isDesktop
  • chayns.env.isInFacebookFrame
  • chayns.env.isInFrame
  • chayns.env.isMobile
  • chayns.env.isMyChaynsApp
  • chayns.env.isApp
  • chayns.env.isIOS
  • chayns.env.isAndroid
  • chayns.env.isTablet
  • chayns.env.isWidget
  • chayns.env.isWP //Windowsphone

Integer:

  • chayns.env.apiVersion
  • chayns.env.appVersion (set in native apps)
  • chayns.env.myChaynsAppVersion (set at locations in mychaynsApp)

String:

  • chayns.env.language
  • chayns.env.os