## MedplumClient.setBasicAuth() method

Sets the client ID and secret for basic auth.

**Signature:**

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

## Parameters

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

**Returns:**

void

## Example

```typescript
medplum.setBasicAuth(import.meta.env.MEDPLUM_CLIENT_ID, import.meta.env.MEDPLUM_CLIENT_SECRET);

// Example Search

await medplum.searchResources('Patient');
```

- [MedplumClient.setBasicAuth() method](/content/docs/sdk/core.medplumclient.setbasicauth#medplumclientsetbasicauth-method/index.html)
- [Parameters](/content/docs/sdk/core.medplumclient.setbasicauth#parameters/index.html)
- [Example](/content/docs/sdk/core.medplumclient.setbasicauth#example/index.html)
