# Type Alias WithHistoryApi

type WithHistoryApi = {
getHistoryApi?: (providerId?: string) => Promise<HistoryApi>;
}

#### Hierarchy

- WithHistoryApi
  - ServerAPI

- Defined in history.ts:126

##### Index

### Properties

getHistoryApi?

## Properties

### `Optional` getHistoryApi

getHistoryApi?: (providerId?: string) => Promise<HistoryApi>

Returns a promise for a History API implementation, or rejects if unavailable. The property is optional to support explicitly older servers that do not have a history api provider.

When called without arguments, returns a proxy to the default provider. When called with a provider id, returns that specific provider's HistoryApi instance.

#### Type Declaration

- - (providerId?: string): Promise<HistoryApi>

  - #### Parameters

    - `Optional` providerId: string

      Optional id of a specific history provider plugin. If omitted, returns the default provider.

    #### Returns Promise<HistoryApi>

    Promise that resolves to a HistoryApi instance if available, or rejects with an error if not.

- Defined in history.ts:137