Keep the browser-only code in a Client Component (`'use client'`). If the library touches `window` at import time, load it with `dynamic(() => import(...), { ssr: false })`. Avoid importing browser-only modules from Server Components, and keep the client boundary as small as possible to limit shipped JS.