Magic Link

Sign up to Citizen to get started.

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

<script src=""/>

2. Initialise the Citizen Sign-in modal

Required: 'authorizationCitizen' - your entity public API key.
Optional: 'redirectSuccessUrl' - the page the magic link redirects on success.


loginType: 'citizenMagicLinkLogin',
authorizationCitizen: '2743cf4e-0055-4a90-856e-9e0d17260c4b',

3. Provide a callback function for successful login.

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


let citizenSignInCallback = function(response) {

if (response.tokenStatus) {
if (response.tokenStatus === ‘GRANTED’) {
} else {
console.log(‘Could not confirm email code’)
} else {
console.log(‘Did not confirm email code’)



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

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


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



let signIn = function() {