Hanko Elements provide web components that add a modern login and registration experience for your users.
register()
function from the hanko-elements
module. This enables the use of web components throughout your application.
<hanko-auth />
element to enable user authentication, and configure the “onSessionCreated” event handler to specify
post-authentication behavior, such as page redirection. Detailed implementation steps are provided in subsequent sections.register()
function from the @teamhanko/hanko-elements
package in your TypeScript or JavaScript file
script
tag with the import statement referencing the CDN-hosted hanko-elements
package URL.
register()
function, call it with your Hanko API URL as an argument to register the Hanko elements with the browser’s CustomElementRegistry
.
cookieSameSite
is set to none
then your application must be served through HTTPS. The Secure
attribute is automatically set to true
if your application uses HTTPS.cookieDomain
to your domain prefixed with a .
. For example,
if your frontend application is running on myapp.com
and you want cookies to be available on api.myapp.com
, then the cookieDomain
value should be .myapp.com
.