Batch SDK - Web
    Preparing search index...

    Interface IProfileDataEditor

    Batch's Profile Data Editor. See https://doc.batch.com/developer/sdk/web/profile-data/attributes for more info.

    interface IProfileDataEditor {
        addToArray: (key: string, value: string[]) => IProfileEditor;
        addToTopicPreferences: (topics: string[]) => IProfileEditor;
        removeAttribute: (key: string) => IProfileEditor;
        removeFromArray: (key: string, value: string[]) => IProfileEditor;
        removeFromTopicPreferences: (topics: string[]) => IProfileEditor;
        setAttribute: (key: string, value: ProfileAttributeValue) => IProfileEditor;
        setEmailAddress: (email: string | null | undefined) => IProfileEditor;
        setEmailMarketingSubscription: (
            state: "subscribed" | "unsubscribed",
        ) => IProfileEditor;
        setLanguage: (language: string | null | undefined) => IProfileEditor;
        setRegion: (region: string | null | undefined) => IProfileEditor;
        setTopicPreferences: (
            topics: string[] | null | undefined,
        ) => IProfileEditor;
    }
    Index
    addToArray: (key: string, value: string[]) => IProfileEditor
    addToTopicPreferences: (topics: string[]) => IProfileEditor

    Add topics to the profile topic preferences.

    Type Declaration

      • (topics: string[]): IProfileEditor
      • Parameters

        • topics: string[]

          Topics to add. Must be a valid List of String not longer than 25 items. String should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 300 characters.

        Returns IProfileEditor

        This object instance, for method chaining.

    removeAttribute: (key: string) => IProfileEditor
    removeFromArray: (key: string, value: string[]) => IProfileEditor
    removeFromTopicPreferences: (topics: string[]) => IProfileEditor

    Remove topics from the profile topic preferences.

    Type Declaration

      • (topics: string[]): IProfileEditor
      • Parameters

        • topics: string[]

          Topics to remove. Must be a valid List of String not longer than 25 items. String should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 300 characters.

        Returns IProfileEditor

        This object instance, for method chaining.

    setAttribute: (key: string, value: ProfileAttributeValue) => IProfileEditor
    setEmailAddress: (email: string | null | undefined) => IProfileEditor

    Associate an email address with this profile.

    This requires having a custom user ID registered with the identify API.

    Type Declaration

      • (email: string | null | undefined): IProfileEditor
      • Parameters

        • email: string | null | undefined

          must be valid, not longer than 256 characters. It must match the following pattern: ^[^@]+@[A-z0-9-.]+.[A-z0-9]+$. Null to erase.

        Returns IProfileEditor

    setEmailMarketingSubscription: (
        state: "subscribed" | "unsubscribed",
    ) => IProfileEditor

    The profile's marketing emails subscription.

    Note that a profile's subscription status is automatically set to unsubscribed when they click an unsubscribe link.

    Type Declaration

      • (state: "subscribed" | "unsubscribed"): IProfileEditor
      • Parameters

        • state: "subscribed" | "unsubscribed"

          You can set it to subscribed or unsubscribed.

        Returns IProfileEditor

    setLanguage: (language: string | null | undefined) => IProfileEditor

    Associate a language with this profile.

    Type Declaration

      • (language: string | null | undefined): IProfileEditor
      • Parameters

        • language: string | null | undefined

          must be 2 chars, lowercase, ISO 639 formatted

        Returns IProfileEditor

    setRegion: (region: string | null | undefined) => IProfileEditor

    Associate a region with this profile.

    Type Declaration

      • (region: string | null | undefined): IProfileEditor
      • Parameters

        • region: string | null | undefined

          must be 2 chars, uppercase, ISO 3166 formatted

        Returns IProfileEditor

    setTopicPreferences: (topics: string[] | null | undefined) => IProfileEditor

    Set the profile topic preferences.

    Type Declaration

      • (topics: string[] | null | undefined): IProfileEditor
      • Parameters

        • topics: string[] | null | undefined

          List of topics to set. Null to reset. Must be a valid List of String not longer than 25 items. String should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 300 characters.

        Returns IProfileEditor

        This object instance, for method chaining.