# Polyfills

Canonical page: https://docs.ovok.com/native-sdk/guide/modules/polyfills

`@ovok/native/polyfills` installs the web APIs that the Ovok client expects and React
Native lacks: `crypto`, `location`, `sessionStorage`, `TextEncoder`, `btoa` and `Event`.
It is a separate subpath so it can run before the rest of the SDK is imported.

## Install them at app start [#install-them-at-app-start]

Call `polyfillOvokWebAPIs` once from the app's entry file, before the router loads
the app and before any client is created.

```js
// index.js, set as "main" in package.json
const { polyfillOvokWebAPIs } = require("@ovok/native/polyfills");

polyfillOvokWebAPIs();
require("expo-router/entry");
```

Keep this file in CommonJS: a static `import` of the app would evaluate SDK modules
before the polyfills exist. Pass a config object to skip individual polyfills, and call
`cleanupOvokNativeRuntime` only in tests that need the original globals back.

## Related [#related]

- [Polyfills and runtime setup](/native-sdk/guide/components/polyfills/)
- [Installation and native setup](/native-sdk/guide/how-to/installation)

## API reference [#api-reference]

Every export of `@ovok/native/polyfills`, with signatures, props and types, is in the [`polyfills` API reference](/native-sdk/reference/polyfills).
