Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

@salesforce/b2c-tooling-sdk / operations/mrt / getProfile

Function: getProfile()

getProfile(options, auth): Promise<{ }>

Defined in: packages/b2c-tooling-sdk/src/operations/mrt/user.ts:83

Gets the profile information for the authenticated user.

Parameters

options

UserOperationOptions

Operation options

auth

AuthStrategy

Authentication strategy (ApiKeyStrategy)

Returns

Promise<{ }>

User profile

Throws

Error if request fails

Example

typescript
import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
import { getProfile } from '@salesforce/b2c-tooling-sdk/operations/mrt';

const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');

const profile = await getProfile({}, auth);
console.log(`User: ${profile.first_name} ${profile.last_name}`);

Released under the Apache-2.0 License.