## MedplumClient.refreshIfExpired() method [​](/content/docs/sdk/core.medplumclient.refreshifexpired#medplumclientrefreshifexpired-method/index.html)

Refreshes the access token using the refresh token if available.

**Signature:**
```typescript
refreshIfExpired(gracePeriod?: number): Promise<void>;
```

## Parameters [​](/content/docs/sdk/core.medplumclient.refreshifexpired#parameters/index.html)

| Parameter | Type | Description |
| --- | --- | --- |
| gracePeriod | number | _(Optional)_ Optional grace period in milliseconds. If not specified, uses the client configured grace period (default 5 minutes). |

**Returns:**

Promise<void>

Promise to refresh the access token.

- [MedplumClient.refreshIfExpired() method](/content/docs/sdk/core.medplumclient.refreshifexpired#medplumclientrefreshifexpired-method/index.html)
- [Parameters](/content/docs/sdk/core.medplumclient.refreshifexpired#parameters/index.html)
