backend/v2.1.0
teamhanko/hankobackend/v2.1.0May 21, 2025by FlxMgdnz
AI Summary
This release introduces customizable user metadata organized into Private, Public, and Unsafe categories. It also improves the `<hanko-auth>` Web Component with a mode attribute and fixes cross-tab communication issues.
Key Highlights
- Customizable user metadata with access control levels
- New `mode` attribute for the `<hanko-auth>` element
- Fixed cross-tab session event synchronization
New Features
- User metadata support (Private/Public/Unsafe)
- Control over `<hanko-auth>` login/registration mode
- Cross-tab communication fix
- User type consistency fix in REST endpoints
Full Release Notes
We are excited to announce the release of **Hanko 2.1**! This release builds on the foundation laid by Hanko 2.0 and introduces new customization capabilities, component enhancements, and bug fixes to improve the overall developer experience. ## New: Customizable User Metadata Hanko now supports **user metadata** that can be attached to user profiles and managed via the Admin API. Metadata is organized into three categories: Metadata type | Public API | Admin API -- | -- | -- Private | No read or write access | Read and write access Public | Read access | Read and write access Unsafe | Read access and write access | Read and write access Metadata can be accessed in session JWT templates to map metadata to claims in a session token. See [backend README](https://github.com/teamhanko/hanko/blob/backend/v2.1.0/backend/README.md#user-metadata) for full details and examples. ## `<hanko-auth>` Mode Attribute The `<hanko-auth>` Web Component now supports a `mode` attribute, allowing you to explicitly control whether it starts in `login` or `registration` mode. Example: ```html <hanko-auth mode="registration"></hanko-auth> ``` This makes it easier to integrate the `<hanko-auth>` Element into a range of different onboarding flows. ## Bug Fixes and Improvements - **Cross-tab communication fix**: Cross-tab session events are now reliably synchronized. A bug caused by a mismatched broadcast channel name has been resolved. - **User type consistency fix**: The `/user` REST endpoint now returns the correct structure expected by the frontend SDK. - **General improvements**: Minor fixes and internal enhancements to improve stability and maintainability. **Full Changelog**: https://github.com/teamhanko/hanko/compare/backend/v2.0.0...backend/v2.1.0