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>

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

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>

Access token from native host app.


getContacts

getContacts(): Promise<Contact[]>

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

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.


getProfilePhoto

getProfilePhoto(): Promise<string>

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

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:13

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.