js-miniapp-sdk

Globals / UserInfoProvider

Interface: UserInfoProvider

Interfaces to retrieve User profile related information.

Hierarchy

Index

Methods

Methods

getAccessToken

getAccessToken(audience: string, scopes: string[]): Promise<AccessTokenData | MiniAppError>

Defined in js-miniapp-sdk/src/modules/user-info.ts:40

Fetches the access token from host app.

Parameters:

Name Type Description
audience string one of the audiences provided in MiniApp manifest
scopes string[] scopes array associated to the audience

Returns: Promise<AccessTokenData | MiniAppError>

Access token from native host app.


getContacts

getContacts(): Promise<Contact[]>

Defined in js-miniapp-sdk/src/modules/user-info.ts:32

Fetches the contact list from host app. You should request the CustomPermissionName.CONTACT_LIST permission before using this method.

Returns: Promise<Contact[]>

Contact list in the host app user profile.


getPoints

getPoints(): Promise<Points>

Defined in js-miniapp-sdk/src/modules/user-info.ts:49

Fetches the points from host app.

Returns: Promise<Points>

Points from native host app.


getProfilePhoto

getProfilePhoto(): Promise<string>

Defined in js-miniapp-sdk/src/modules/user-info.ts:25

Fetches the profile photo URI from host app. You should request the CustomPermissionName.PROFILE_PHOTO permission before using this method.

Returns: Promise<string>

Profile photo saved in the host app user profile.


getUserName

getUserName(): Promise<string>

Defined in js-miniapp-sdk/src/modules/user-info.ts:18

Fetches the username from host app. You should request the CustomPermissionName.USER_NAME permission before using this method.

Returns: Promise<string>

Username saved in the host app user profile.