Passwordless

Sign up to Citizen to get started.

Allow customers to login to your site without passwords.

1. Add our sign-in SDK to the html header of your webpage.

<script src="https://sdk.citizen.is/sdk/sdk.js"/>

2. Initialise the Citizen Sign-in modal

<script>

window.citizenAsyncInit = function () {
CITIZEN.init({
mode: 'modal',
})
};

</script>

3. Provide a callback function for successful login.

In most scenarios, this will simply set a cookie and redirect.

<script>

let citizenSignInCallback = function(response) {
window.location.replace('/demo/loggedin/');
}

</script>

4. Add the Citizen Sign-in button to your webpage.

Adding a button with an onclick function is enough for most scenarios.

<html>

<button class="ctznSigninButton ctznButtonSigninSubmit" onclick="signIn()">SIGN IN WITH</button>

</html>

<script>

let signIn = function() {
window.CITIZEN.login(citizenSignInCallback);
}
</script>