The <passage-login> custom element renders a UI element for users to login to your website. The Login Element currently supports login with biometrics (e.g. FaceID, Windows Hello) and magic links via email or SMS.

You should use the <passage-login> element if your website allows users to self-register and you want different UI/UX for login and registration. For example, you might have some marketing material on the registration page but want a clean, simple login page for returning users. You can use the Login and Register Elements to achieve this. These elements can be styled differently and can have different callbacks for authentication logic customization.

Example Usage

Make sure you've created an application in the Passage Console with your domain and redirect URL configured. Once you've done that, the Login Element should work out of the box.

Install Passage using NPM

npm install --save @passageidentity/passage-elements

or from our CDN.

<script src="https://psg.so/web.js"></script>

Using the App ID provided in the Passage Console, add the Login Element to your application as follows. To see full example, please see the our guides and examples for different frontend frameworks.

import '@passageidentity/passage-elements/passage-login';

function Login() {
  return (
        <passage-login app-id="<YOUR APP_ID HERE>"></passage-login>
export default Login;


The Login element can be highly customized using CSS variables or parts. See our in-depth guide on UI customization here.

You can also add custom logic around your authentication using JavaScript callbacks. Passage elements support a beforeAuth and onSuccess callback. See how to customize your workflow here.

Last updated