#1404·nuqs

Required option for query params

Author: nimrossumCreated May 16, 2026Updated May 16, 2026

Similar to strict, it would be handy with a required option that throws if the parameter is missing

typescript
const searchParamsConfig = {
  count: parseAsInteger.withOptions({ required: true }),
}

const loadSearchParams = createLoader(searchParamsConfig )

// Expected:
const { count, contributors } = loadSearchParams(request, { strict: true })
//      count: number