# @ovok/native/cms

Canonical page: https://docs.ovok.com/native-sdk/reference/cms

Hooks that read CMS content, locales and translations.

Import from `@ovok/native/cms`.

## Hooks [#hooks]

### useCmsDocument() [#usecmsdocument]

```ts
function useCmsDocument<T>(
   collection,
   slug,
   options?
): OvokQueryState<T>;
```

Fetches one CMS document by collection and slug, in the current CMS locale unless `options.locale` is set; disabled while `slug` is `undefined`.

#### Type Parameters [#type-parameters]

| Type Parameter | Default type |
| ------ | ------ |
| <a id="type-parameter-t"></a> `T` *extends* `object` | `OvokCmsDocument` |

#### Parameters [#parameters]

| Parameter | Type |
| ------ | ------ |
| `collection` | `string` |
| `slug` | `string` \| `undefined` |
| `options?` | `CmsReadParams` |

#### Returns [#returns]

`OvokQueryState`\<`T`\>

***

### useCmsDocuments() [#usecmsdocuments]

```ts
function useCmsDocuments<T>(collection, options?): OvokQueryState<Page<T>>;
```

Fetches the documents of a CMS collection, in the current CMS locale unless `options.locale` is set.

#### Type Parameters [#type-parameters-1]

| Type Parameter | Default type |
| ------ | ------ |
| <a id="type-parameter-t-1"></a> `T` *extends* `object` | `OvokCmsDocument` |

#### Parameters [#parameters-1]

| Parameter | Type |
| ------ | ------ |
| `collection` | `string` |
| `options?` | `CmsListParams` |

#### Returns [#returns-1]

`OvokQueryState`\<`Page`\<`T`\>\>

***

### useCmsLocale() [#usecmslocale]

```ts
function useCmsLocale(): string;
```

Returns the current i18n language as a CMS locale.

#### Returns [#returns-2]

`string`

***

### useCmsTranslations() [#usecmstranslations]

```ts
function useCmsTranslations(options?): OvokQueryState<OvokTranslations>;
```

Loads the CMS translations for the current or given locale and merges them into the app's i18n resources.

#### Parameters [#parameters-2]

| Parameter | Type |
| ------ | ------ |
| `options?` | `CmsReadParams` |

#### Returns [#returns-3]

`OvokQueryState`\<`OvokTranslations`\>

***

### useLegalPage() [#uselegalpage]

```ts
function useLegalPage(slug, options?): OvokQueryState<OvokCmsDocument>;
```

Fetches a legal page by slug, in the current CMS locale unless `options.locale` is set; disabled while `slug` is `undefined`.

#### Parameters [#parameters-3]

| Parameter | Type |
| ------ | ------ |
| `slug` | `string` \| `undefined` |
| `options?` | `CmsReadParams` |

#### Returns [#returns-4]

`OvokQueryState`\<`OvokCmsDocument`\>

***

### useReleaseNotes() [#usereleasenotes]

```ts
function useReleaseNotes(options?): OvokQueryState<Page<OvokCmsDocument>>;
```

Fetches the release notes, in the current CMS locale unless `options.locale` is set.

#### Parameters [#parameters-4]

| Parameter | Type |
| ------ | ------ |
| `options?` | `CmsListParams` |

#### Returns [#returns-5]

`OvokQueryState`\<`Page`\<`OvokCmsDocument`\>\>
