core.medplumclient.startclientlogin | Medplum

MedplumClient.startClientLogin() method

Starts a new OAuth2 client credentials flow.

Signature:

startClientLogin(clientId: string, clientSecret: string): Promise<ProfileResource>;

Parameters

Parameter Type Description
clientId string The client ID.
clientSecret string The client secret.

Returns:

Promise< ProfileResource >

Promise that resolves to the client profile.

Example

await medplum.startClientLogin(import.meta.env.MEDPLUM_CLIENT_ID, import.meta.env.MEDPLUM_CLIENT_SECRET)

// Example Search

await medplum.searchResources('Patient')

See RFC 6749 Section 4.4 for full details.