Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

addUserProfileEventListener

  • description

    Add listener for the given UserProfileEvent

    since

    2.13.0

    example
    addUserProfileEventListener(UserProfileEvent.BLOCK_PROFILE, function onBlockProfileListener(blockInfo){
    console.log(blockInfo);
    })

    Parameters

    Returns void

Const createUserProfile

  • createUserProfile(args: { nickname?: string }): Promise<IUserProfile>
  • Creates user profile. If no nickname argument is passed, a random nickname will be generated.

    async
    since

    1.18.0

    example
    createUserProfile({ nickname: 'Test Nickname' }).then(profile => console.log(profile))
    

    Parameters

    • args: { nickname?: string }
      • Optional nickname?: string

        Optional nickname

    Returns Promise<IUserProfile>

Const getUserProfile

  • getUserProfile(args: { accessToken?: string; profileId?: string }): Promise<IUserProfile>
  • Gets userProfile from accessToken.

    async
    since

    1.18.0

    example
    getUserProfile({ accessToken }).then(profile => console.log(profile))
    

    Parameters

    • args: { accessToken?: string; profileId?: string }
      • Optional accessToken?: string
      • Optional profileId?: string

    Returns Promise<IUserProfile>

removeUserProfileEventListener

  • description

    Remove registered listenerFn for the given UserProfileEvent, when no listener passed, all registered event listener will be removed

    since

    2.13.0

    example
    removeUserProfileEventListener(UserProfileEvent.BLOCK_PROFILE, onBlockProfileListener);
    

    Parameters

    Returns void

Const updateUserProfile

  • updateUserProfile(args: { accessToken: string; options?: { custom_data?: string; nickname?: string } }): Promise<IUserProfile>
  • Updates profile by accessToken with optional changed nickname or custom_data.

    async
    since

    1.18.0

    example
    const options = {nickname: 'New Nickname'}
    updateUserProfile({accessToken, options}).then(profile => console.log(profile))

    Parameters

    • args: { accessToken: string; options?: { custom_data?: string; nickname?: string } }
      • accessToken: string

        userProfile access_token

      • Optional options?: { custom_data?: string; nickname?: string }
        • Optional custom_data?: string

          Data saved to profile's custom_data property

        • Optional nickname?: string

          The nickname to update the userProfile

    Returns Promise<IUserProfile>

Legend

  • Namespace
  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Interface
  • Interface with type parameter
  • Enumeration

Generated using TypeDoc