Skip to main content
Version: v2

Customization

You can change the look of our screens with theme, and their text with translations.

Theme​

Pass a theme object to createPlatformSdk or usePlatformSdk. Every property is optional:

  • accent (string): the primary color of buttons, links, and highlights. Accepts any CSS color value.
  • fontFamily (string): any CSS font-family value. Your page must load the font itself.
  • buttonBorderRadius (string | number): any CSS length, or a number of pixels. By default, buttons are fully rounded.
  • icons (object): replacement images, keyed by icon name. Each value is anything that <img src> accepts: a URL, a path in your public directory, or an imported asset.
import { createPlatformSdk, type ThemeConfig } from '@microblink/platform-sdk';

const theme: ThemeConfig = {
accent: '#0f766e',
fontFamily: "'Inter', sans-serif",
buttonBorderRadius: 8,
icons: {
identityVerified: '/brand/verified.svg',
identityNotVerified: '/brand/not-verified.svg',
identityVerifying: '/brand/verifying.svg',
},
};

createPlatformSdk({ sessionToken, theme });

Icons​

You can replace these icons:

  • identityVerified, identityNotVerified, identityVerifying: the image on the result screen when the verification is accepted, rejected, or under review.
  • verification: the image on the progress overview.
  • failed: the image on the error screen.
  • cameraUnavailable: the image on the screen shown when a camera step can't use the camera.
  • check: the tick on a completed step, and inside a checked checkbox.
  • upload: the prompt inside the document upload drop zone.
  • trash: the button that removes an uploaded document.
  • x: the close button in the top corner of every screen.
  • qr, phone, desktop: the bullets of the "How it works" list on the device-to-device QR code screen.
  • d2dTransfer: the image on the QR code screen, and on the phone when it has finished.
  • d2dConnected: the image on the desktop while the phone runs the verification.
  • d2dConnectionLost: the image on the desktop when the phone disconnects.
  • d2dDevicesError: the image on the desktop when the handoff to the phone can't start.
  • d2dLinkError, d2dPhoneError, d2dPhoneWarning: the images on the phone's error and stopped screens, and on the desktop's screens for stopping the verification on the phone.

Translations​

Pass a translations object to createPlatformSdk or usePlatformSdk. It replaces any subset of the built-in English text: the text you don't provide stays as it is.

The text is grouped by screen, and you provide each value under its group:

import { createPlatformSdk, type TranslationOverrides } from '@microblink/platform-sdk';

const translations: TranslationOverrides = {
actions: {
tryAgain: 'Erneut versuchen',
exit: 'Beenden',
continueButton: 'Weiter',
},
end: {
acceptTitle: 'Identität bestätigt!',
done: 'Fertig',
},
};

createPlatformSdk({ sessionToken, translations });

The groups are:

  • steps: the names and descriptions of the steps in the progress overview.
  • progressOverview: the title and subtitle of the progress overview.
  • loading: the loading screen.
  • error: the error screen, with separate text for each type of error.
  • cameraUnavailable: the screen shown when a camera step can't use the camera, with separate text for each reason.
  • actions: buttons that appear on several screens, such as Try again and Exit.
  • manualInput: the form that collects data from the user, including the validation messages.
  • documentUpload: the document upload screens.
  • d2d: the device-to-device screens on the desktop and on the phone.
  • end: the result screen.
  • cameraManager: the camera controls of every camera step, such as the camera permission dialog, the camera picker, and the torch and mirror buttons. Passed as it is to the scanning SDKs.
  • documentScan, cardScan, faceCapture: passed as they are to the scanning SDKs' own localization strings, for the document scanning, card scanning, and face capture steps.

The TranslationOverrides type lists every key in each group. Some values contain placeholders in double curly braces, such as {{field}} or {{max}}; keep them in your translations.