Error - You need to polyfill atob to use the client in your environment

Why this error occurred

You are using @liveblocks/client within a JavaScript runtime which doesn't implement atob. (environments like React Native or Node < 16)

Possible ways to fix it

As a polyfill, we recommend installing the package base-64.

$npm install base-64

Then you can pass the decode function to our atob polyfill option when you create the client.

src/index.js
import { decode } from "base-64";
const client = createClient({ /* ... your other client's options */ polyfills: { atob: decode, },});

We use cookies to collect data to improve your experience on our site. Read our Privacy Policy to learn more.