import { Meta } from '@storybook/addon-docs/blocks'

<Meta title='@dxtmisha/en/nitro-basic/Functions/initPluginBasic - Basic Nitro Plugin Initialization'/>

# `initPluginBasic`

An initialization function for basic capabilities in a Nitro application. Currently, it is primarily responsible for configuring the API cache using the provided configuration.

**Parameters:**
- `_ : NitroApp` — The Nitro application instance.
- `config: NitroAppBasicConfig` — The configuration object.

## Types

### NitroAppBasicConfig

- `api?: object` — API settings.
  - `cacheStorageKey: string` — the key prefix to be used in Nitro storage for the cache (default `Ui_ApiCache`).
  - `cacheStepAgeClearOld: number` — the cache age threshold after which old entries will be removed.

**Usage Example:**

```typescript
import { initPluginBasic } from '@dxtmisha/nitro-basic'

export default defineNitroPlugin((nitroApp) => {
  initPluginBasic(nitroApp, {
    api: {
      cacheStorageKey: 'my_app_cache',
      cacheStepAgeClearOld: 3600000 // 1 hour
    }
  })
})
```
