Changelog
All notable changes to next-api-layer are documented here.
v0.1.6 - April 7, 2026#
Added#
- Per-request sanitization control: New options in
RequestOptionsfor fine-grained sanitization controlskipSanitize: boolean- Skip all sanitization for a specific requestskipSanitizeFields: string[]- Skip sanitization for specific fields only
patch()method now acceptsRequestOptionsparameter (was missing)
Example Usage#
TypeScript
Loading...
Migration from v0.1.5#
No breaking changes. Simply update your package:
Terminal
Loading...
v0.1.5 - April 4, 2026#
Added#
- i18n Support: Automatic locale detection and injection for API requests
- Added
i18nconfig option tocreateAuthProxyfor locale detection from URL path - Added
i18nconfig option tocreateApiClientfor auto-appending?lang={locale}to requests - New
x-localeheader for passing locale from middleware to route handlers - Configurable
paramName(default:lang),locales, anddefaultLocale
- Added
Changed#
HEADERSconstant now includesLOCALE: 'x-locale'- Proxy handlers now extract locale from URL pathname and set
x-localeheader - API client reads
x-localeheader and appends locale query parameter to backend requests
Migration from v0.1.4#
No breaking changes. To enable i18n, add the config:
TypeScript
Loading...
v0.1.4 - April 1, 2026#
Fixed#
- Empty cookie creation bug: Fixed an issue where
cookies.delete()was called on non-existent cookies, causing empty-value cookies to be set in the browser. Now all delete operations check for cookie existence before attempting deletion.
Added#
- New
safeDeleteCookiehelper function that only deletes cookies that actually exist in the request. - Updated
deleteAllAuthCookiesto acceptreqparameter for cookie existence checking.
Changed#
- All cookie delete operations now verify cookie existence before deletion to prevent phantom cookies.
Migration from v0.1.3#
No breaking changes. Simply update your package:
Terminal
Loading...
v0.1.3 - March 20, 2026#
Added#
- Initial stable release with proxy and API client functionality
- Guest token support with automatic creation
- Token validation and refresh mechanisms
- Rate limiting support
- CSRF protection
- Audit logging capabilities
- next-intl integration support
Features#
createAuthProxy- Main proxy function for Next.jscreateApiClient- Server-side API clientcreateProxyHandler- Flexible proxy handler for route handlersuseAuth- Client-side auth hookAuthProvider- React context providergetServerUser- Server-side user helper