> For the complete documentation index, see [llms.txt](https://jcquintas.gitbook.io/ni18n/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jcquintas.gitbook.io/ni18n/usage/client-side-loading.md).

# Client Side Loading

All the namespaces are always loaded on the client side if no [loadTranslations](/ni18n/usage/server-side-loading.md) or `clientNamespaces` are called on a page's server callback. In order to prevent that, you can use `clientNamespaces` to only allow the client to load the specific namespaces given to the function.

```typescript
// pages/index.ts

export const getStaticProps = async (props) => {
  return {
    props: {
      ...clientNamespaces(['client-namespace']),
    },
  }
}
```

You can use both [loadTranslations](/ni18n/usage/server-side-loading.md) or `clientNamespaces` in the same page if necessary.

```typescript
// pages/index.ts

export const getStaticProps = async (props) => {
  return {
    props: {
      ...(await loadTranslations(ni18nConfig, props.locale, [
        'server-namespace',
      ])),
      ...clientNamespaces(['client-namespace']),
    },
  }
}
```
