> ## Documentation Index
> Fetch the complete documentation index at: https://docs.li.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Polyfill Requirements

> JavaScript polyfills required for browser compatibility

The LI.FI Widget uses modern JavaScript APIs that may not be supported in older environments. Partners integrating the Widget may need to add polyfills if they need to support older browsers.

<Note>
  Polyfills are only needed if you must support an environment where an API below is marked ❌. The polyfill packages/imports in this page are **suggestions**—you can use any equivalent polyfill solution as long as it provides the same API behavior.
</Note>

## Browser & API Support

| API                     | Polyfill                               | iOS 15.0-15.3 | iOS 15.4+ | iOS 16.0+ | Chrome 92+ | Firefox 92+ | Safari 15.4+ | Safari 16.0+ | Samsung 16.0+ |
| ----------------------- | -------------------------------------- | ------------- | --------- | --------- | ---------- | ----------- | ------------ | ------------ | ------------- |
| `structuredClone()`     | `core-js/actual/structured-clone`      | ❌             | ✅         | ✅         | ✅          | ✅           | ✅            | ✅            | ✅             |
| `Array.at()`            | `core-js/actual/array/at`              | ❌             | ✅         | ✅         | ✅          | ✅           | ✅            | ✅            | ✅             |
| `Object.hasOwn()`       | `core-js/actual/object/has-own`        | ❌             | ✅         | ✅         | ✅          | ✅           | ✅            | ✅            | ✅             |
| `Array.findLast()`      | `core-js/actual/array/find-last`       | ❌             | ✅         | ✅         | ✅          | ✅           | ✅            | ✅            | ✅             |
| `Array.findLastIndex()` | `core-js/actual/array/find-last-index` | ❌             | ✅         | ✅         | ✅          | ✅           | ✅            | ✅            | ✅             |
| `Array.toSpliced()`     | `core-js/actual/array/to-spliced`      | ❌             | ❌         | ✅         | ✅          | ✅           | ❌            | ✅            | ✅             |
| `Array.toSorted()`      | `core-js/actual/array/to-sorted`       | ❌             | ❌         | ✅         | ✅          | ✅           | ❌            | ✅            | ✅             |
| `Array.with()`          | `core-js/actual/array/with`            | ❌             | ❌         | ✅         | ✅          | ✅           | ❌            | ✅            | ✅             |

**Legend:** ❌ Not supported (requires polyfill) | ✅ Fully supported

## Polyfill Setup (Examples)

### Install a polyfill library

```bash theme={"system"}
npm install core-js
```

### Import polyfills (choose one approach)

**Option A: simplest (larger bundle)**

```javascript theme={"system"}
// Place at the very beginning of your app entry point (before importing the Widget)
import 'core-js'
```

**Option B: only what you need (smaller bundle)**

```javascript theme={"system"}
// Place at the very beginning of your app entry point (before importing the Widget)
import 'core-js/actual/structured-clone'
import 'core-js/actual/array/at'
import 'core-js/actual/object/has-own'
import 'core-js/actual/array/find-last'
import 'core-js/actual/array/find-last-index'
import 'core-js/actual/array/to-spliced'
import 'core-js/actual/array/to-sorted'
import 'core-js/actual/array/with'
```
