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

Parameter

Type

Description

clientId

string

The client ID.

clientSecret

string

The 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');