Options
All
  • Public
  • Public/Protected
  • All
Menu

Class User

A user of your app. This is a vanilla JavaScript object with no behavior. TalkJS uses id to uniquely identify this user. All other fields are allowed to vary over time and the TalkJS database will update its fields accordingly.

Hierarchy

  • User

Index

Constructors

constructor

  • new User(id: string | number): User
  • new User(options: object): User
  • new User(args: object, isInternal: true): User
  • Creates a User object without any user data. Use this constructor if you're sure that a user by the given id already exists in TalkJS (for instance, because you synchronized it via the REST API).

    The fields id, name and email are required. A warning will be emitted if configuration is not specified.

    Set email to null if you want to use TalkJS without email fallback.

    Parameters

    • id: string | number

    Returns User

  • Use this constructor to synchronize user data with the TalkJS backend.

    The fields id, name and email are required. A warning will be emitted if configuration is not specified.

    Set email to null if you want to use TalkJS without email fallback.

    Parameters

    • options: object
      • availabilityText: undefined | string
      • configuration: undefined | string
      • custom: undefined | object
      • email: undefined | null | string | string[]
      • id: string | number
      • locale: undefined | string
      • name: string
      • phone: undefined | null | string | string[]
      • photoUrl: undefined | string
      • role: undefined | string
      • welcomeMessage: undefined | string

    Returns User

  • Creates a User object without any user data. Use this constructor if you're sure that a user by the given id already exists in TalkJS (for instance, because you synchronized it via the REST API). Use this constructor to synchronize user data with the TalkJS backend.

    The fields id, name and email are required. A warning will be emitted if configuration is not specified.

    Set email to null if you want to use TalkJS without email fallback.

    Parameters

    • args: object
      • Optional availabilityText?: undefined | string
      • Optional configuration?: undefined | string
      • Optional custom?: undefined | object
      • Optional email?: string | Array<string> | null
      • id: string
      • internalId: string
      • Optional locale?: undefined | string
      • name: string
      • Optional phone?: string | Array<string> | null
      • Optional photoUrl?: undefined | string
      • Optional role?: undefined | string
      • Optional welcomeMessage?: undefined | string
    • isInternal: true

    Returns User

Properties

Optional availabilityText

availabilityText: undefined | string

Optional configuration

configuration: undefined | string

Optional custom

custom: undefined | object

Optional email

email: string | Array<string> | null

id

id: string

internalId

internalId: string

Optional locale

locale: undefined | string

name

name: string

Optional phone

phone: string | Array<string> | null

Optional photoUrl

photoUrl: undefined | string

Optional role

role: undefined | string

Optional welcomeMessage

welcomeMessage: undefined | string

Generated using TypeDoc