News for hackers. Stuff that matters.

Show HN: Type-safe search params state management for Next.js

https://nuqs.47ng.com

Next.js has APIs to read and update search params (the /?foo=bar part of the URL), but they lack type-safety for consistent keys and proper parsing/serializing of JS data types. I found myself repeatedly building the same custom hook to get a React.useState-like approach. In 2021, I published it to NPM and then forgot about it.

Since then, the `nuqs` package has gained popularity and is now used by companies like Vercel, Auth.js, Gitbook, and Midday.ai, with 200K weekly downloads.

It's been fun building this as a side project and automating as much as possible to ensure a high-quality output.

( 1 comment | 3 points | on HN )
Re:Show HN: Type-safe search params state management for Nex... by pontusabra on Monday August 05, 2024 @01:37PM (#41163468)
I really love nuqs, recommend it to everyone! thanks!