In case you'd rather have the verification process handled outside of your application, you can send your users to an URL, that is managed directly on Passbase.
You can get your own customizable organization slug. e.g. https://verify.passbase.com/YOURCOMPANY
https://verify.passbase.com/:organization_slug
An example of this solution is this Passbase Demo.
If you haven't done so before, head towards app.passbase.com and turn on 'Enable V2 for your verification link'.
In order to prefill the email of a verification & skip this step or to preselect a country from the dropdown, you can pass a base64 encoded parameter string at the end of the request like below.
// Your Linkhttps://verify.passbase.com/:organization_slug​// Your link including an encoded string for customizationshttps://verify.passbase.com/:organization_slug?p={BASE64_ENCODED_STRING}
The encoded object should be a JSON object consisting of the following (optional) key-value pairs:
Key | Value |
|
|
​ |
|
If you don't want to build this functionality into your backend, you can also use this tool to encode your hosted link with a user email online: Passbase Link Encoder​
The code for this project is on Github here.
Below is an example where we prefill an user's email and set the country for the top document of the id document list to Germany:
const prefillAttributes = {prefill_attributes: {email: "user@email.de",country: "de"}}const objJsonStr = JSON.stringify(prefillAttributes);const objJsonB64 = Buffer.from(objJsonStr).toString("base64");​// Your Linkconst link = "https://verify.passbase.com/" + "YOUR_SLUG" + "/?p=" + objJsonB64​// Result:// https://verify.passbase.com/YOUR_SLUG/?p=eyJwcmVmaWxsX2F0dHJpYnV0ZXMiOnsiZW1haWwiOiJ1c2VyQGVtYWlsLmRlIiwiY291bnRyeSI6ImRlIn19
import jsonimport base64​yourCompanySlug = "mathias"yourPassbaseLink = "https://verify.passbase.com/" + yourCompanySlug​prefillAttributes = {"prefill_attributes": {"email": "user@email.de","country": "de"}}jsonString = json.dumps(prefillAttributes)encoded = base64.b64encode(jsonString.encode('utf-8'))encodedStr = str(encoded, "utf-8")link = yourPassbaseLink + '?p=' + encodedStr​# Result# https://verify.passbase.com/YOUR_SLUG?p=eyJwcmVmaWxsX2F0dHJpYnV0ZXMiOiB7ImVtYWlsIjogInVzZXJAZW1haWwuZGUiLCAiY291bnRyeSI6ICJkZSJ9fQ==
require "base64"require 'json'​yourCompanySlug = "mathias"yourPassbaseLink = "https://verify.passbase.com/" + yourCompanySlug​preFillAttributes = {'prefill_attributes' => {'email' => 'user@email.de','country' => 'de'}}encoded = Base64.strict_encode64(preFillAttributes.to_json)link = yourPassbaseLink + "?p=" + encoded​# Result# https://verify.passbase.com/YOUR_SLUG/?p=eyJwcmVmaWxsX2F0dHJpYnV0ZXMiOnsiZW1haWwiOiJ1c2VyQGVtYWlsLmRlIiwiY291bnRyeSI6ImRlIn19
$slug = "mathias";$yourPassbaseLink = "https://verify.passbase.com/".$slug;​$hash_map = array('prefill_attributes' => array('email' => 'user@email.de','country' => 'de'),);​$encodedAttributes = base64_encode(json_encode($hash_map));$encodedLink = $yourPassbaseLink."?p=".$encodedAttributes;​# Result# https://verify.passbase.com/YOUR_SLUG/?p=eyJwcmVmaWxsX2F0dHJpYnV0ZXMiOnsiZW1haWwiOiJ1c2VyQGVtYWlsLmRlIiwiY291bnRyeSI6ImRlIn19