## MedplumClient.startClientLogin() method

Starts a new OAuth2 client credentials flow.

**Signature:**

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

## Parameters

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

**Returns:**

Promise< [ProfileResource](/content/docs/sdk/core.profileresource) >

Promise that resolves to the client profile.

## Example

```typescript
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](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4) for full details.
