Show HN: Type-safe search params state management for Next.js (nuqs.47ng.com)

10 points by franky47 ↗ HN
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

[ 5.1 ms ] story [ 9.6 ms ] thread
I really love nuqs, recommend it to everyone! thanks!