The verification-ui package provides a quick way to setup email identity verification with Tanker. It comes with a built-in UI and handles all necessary states for basic usage.

If you wish to customize the identity verification flow, please refer at the guides section.

Installation and usage

See Core documentation for instructions on how to install and use the @tanker/verification-ui package.

Goal

A UI element that wraps a Tanker client in order to handle the verification process on its own. It takes the form of a modal that will appear as needed, send the verification code to the user and prompt them for said code.

Dependency

npm install @tanker/verification-ui
# or...
yarn add @tanker/verification-ui

Import

import VerificationUI from '@tanker/verification-ui';
// or...
const { VerificationUI } = require('@tanker/verification-ui');

Constructor

const config = { appId: 'your-app-id' };
const tanker = new Tanker(config);
const verificationUI = new VerificationUI(tanker);
Parameters Description
tanker: Tanker An instance of a Tanker client to wrap

Note

This documentation uses flow type annotations.

Start

Show the verification modal as required and block until the user verifies their identity.

const { email, identity, provisionalIdentity } = await myApp.getCurrentUser();
await verificationUI.start(email, identity, provisionalIdentity);
Parameters Description
email: string The email address to which emails will be sent to verify the user's identity
identity: string The Tanker identity for the given user
provisionalIdentity?: string A Tanker provisional identity that should be claimed by the user. It only needs to be verified once and will be ignored if given again (optional)