Implements

  • BatchProfileAttributeEditor

Constructors

Methods

  • Add value to an array attribute. If the array doesn't exist it will be created.

    Parameters

    • key: string

      Attribute key. Cannot be null, empty or undefined. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters.

    • value: string | string[]

      The value to add. Cannot be null, undefined or empty. Must be an array of string or a string no longer than 64 characters.

    Returns this

  • Remove an attribute

    Parameters

    • key: string

      The key of the attribute to remove

    Returns this

  • Remove a value from an array attribute.

    Parameters

    • key: string

      Attribute key. Cannot be null, empty or undefined. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters.

    • value: string | string[]

      The value to remove. Can be a String or an Array of String. Cannot be null, empty or undefined.

    Returns this

  • Set an attribute for a key

    Parameters

    • key: string

      Attribute key. Cannot be null, empty or undefined. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters.

    • value:
          | string
          | number
          | boolean
          | string[]
          | Date
          | URL

      Attribute value. Accepted types are numbers, booleans, Date objects and strings. Strings must not be empty or longer than 64 characters.

    Returns this

  • Set the user email address.

    This requires to have a custom user ID registered or to call the setIdentifier method on the editor instance beforehand.

    Parameters

    • email: null | string

      A valid email address. Null to erase.

    Returns this

  • Set the user email marketing subscription state

    Parameters

    • state: "subscribed" | "unsubscribed"

      The state of the marketing email subscription. Must be "subscribed" or "unsubscribed".

    Returns this

  • Set the application language. Overrides Batch's automatically detected language. Send null to let Batch autodetect it again.

    Parameters

    • language: null | string

      Language code. 2 chars minimum, or null

    Returns this

  • Set the application region. Overrides Batch's automatically detected region. Send "null" to let Batch autodetect it again.

    Parameters

    • region: null | string

      Region code. 2 chars minimum, or null

    Returns this