Skip to main content

core.medplumclient.setbasicauth

Home > @medplum/core > MedplumClient > setBasicAuth

MedplumClient.setBasicAuth() method

Sets the client ID and secret for basic auth.

Signature:

setBasicAuth(clientId: string, clientSecret: string): void;

Parameters

ParameterTypeDescription
clientIdstringThe client ID.
clientSecretstringThe client secret.

Returns:

void

Example

medplum.setBasicAuth(import.meta.env.MEDPLUM_CLIENT_ID, import.meta.env.MEDPLUM_CLIENT_SECRET);
// Example Search
await medplum.searchResources('Patient');