Instructions
These components can be used to capture id document or liveness images
user-details
<smileid-user-details> is a standalone, product-agnostic form that collects
the end user's name and a contact method (email and/or phone). It is used by
the v3 SmartSelfie flow when the partner config omits user_details, and can
be mounted by any product without pulling in the selfie/smart-camera-web
bundle.
import '@smileid/web-sdk/user-details';
<smileid-user-details theme-color="#001096"></smileid-user-details>
Attributes
theme-color— primary colour of the Continue button (default#001096).hide-attribution—"true"to hide the "Powered by Smile ID" footer.
Event
smileid-user-details.submitted— dispatched onwindowwhen the user submits a valid form.event.detailis{ given_names, last_name, email?, phone_number? }(at least one ofemail/phone_number; phone normalized to E.164). The payload type is exported asUserDetailsPayload.
consent
<smileid-consent> is a standalone, product-agnostic, region-aware consent
screen. It is shown by v3 product flows (SmartSelfie, DocV, Biometric KYC, …)
when the partner config omits a granted consent_information, and can be
mounted by any product without pulling in the selfie/smart-camera-web
bundle.
import '@smileid/web-sdk/consent';
<smileid-consent
theme-color="#001096"
partner-name="Acme"
policy-url="https://acme.example/privacy"
consent-region="eu"
></smileid-consent>
Attributes
theme-color— primary colour of the Allow button (default#001096).hide-attribution—"true"to hide the "Powered by Smile ID" footer.partner-name— partner name interpolated into the notice copy.partner-logo— partner logo URL shown in the header lockup.policy-url— partner privacy-policy URL linked from "Learn more".consent-region—"eu"starts the checkbox un-ticked and blocks Allow until ticked (regulated regions);"non-eu"may start pre-ticked; any other value (or none) auto-detects from the browser's locale/timezone, defaulting to the compliance-safe"eu"behaviour when ambiguous. The initial checkbox state is read on first render, so setconsent-regionbefore inserting the element into the DOM.
Events
smileid-consent.granted— dispatched onwindowwhen the user grants consent.event.detailis{ granted: true, granted_at }(granted_atis an ISO 8601 timestamp). Consumers enrich this into the full v3consentpart by addingnotice_languageandnotice_privacy_policy_urlfrom their own config. The detail type is exported asConsentGrantedDetail.smileid-consent.denied— dispatched onwindowwhen the user declines.
Localization
The web components support multiple languages and string customization through the localisation module.
Quick Start
import { setCurrentLocale, getDirection } from '@smileid/web-sdk/localisation';
// Set language (supports 'en-GB', 'fr-FR', 'ar-EG')
await setCurrentLocale('fr-FR');
// Apply RTL direction for Arabic
document.documentElement.dir = getDirection();
Customizing Strings
Override specific UI text:
await setCurrentLocale('en-GB', {
locales: {
'en-GB': {
selfie: {
instructions: {
title: 'Verify your identity with a selfie',
},
},
},
},
});
Adding Custom Languages
Register a new language:
import {
registerLocale,
setCurrentLocale,
} from '@smileid/web-sdk/localisation';
registerLocale('sw-KE', {
direction: 'ltr',
common: {
back: 'Rudi',
continue: 'Endelea',
// ... all required keys
},
});
await setCurrentLocale('sw-KE');
Full Localization Guide - Complete documentation including available languages, all translation keys, and custom language setup.
Orchestration
To build your own flow, we have several components that can be used together.
document-capture-instructions
This is the screen used to instruct the user how to capture document using both the camera and/or upload.