client-only is a tiny utility to conditionally execute code only in the browser environment. It prevents server-side rendering (SSR) issues by ensuring modules or components are only loaded and executed within a client-side context. This helps avoid errors related to window, document, or other browser-specific APIs not available on the server. It's simple to use and beneficial for libraries or components with client-side dependencies.
The npm package client-only saw a single release (version 0.0.1) in September 2022. Since then, it has been inactive, with no new versions published from October 2022 through September 2025. The package has remained unchanged for approximately three years.
The npm package client-only experienced strong growth from March 2024 to August 2025, peaking at 48.8 million downloads. Download numbers have generally increased each month. September 2025 shows a partial month with 21.6 million downloads, indicating potentially lower overall downloads compared to preceding months.