V3 JS SDK Overview
The LoginRadius V3 JavaScript SDK delivers a lightweight runtime, modern hooks, and streamlined customization for any web page, whether you embed it directly on your own site or deploy it through Hosted Pages. It provides full control over authentication flows, UI behavior, and validation without vendor lock-in.
This document covers how you can utilize our various features and functionalities via using JavaScript. We have explained the implantation of LoginRadius via JS in detail below, you can customize the provided code as per your need while implementing it on your web property.
Quickstart
Initialize and render V3 components via CDN on your website.
1) Include SDK (CDN)
<link rel="stylesheet" href="https://auth-dev.lrinternal.com/LoginRadiusV3.css" />
<script src="https://auth-dev.lrinternal.com/LoginRadiusV3.js"></script>
Place scripts before code that uses LoginRadiusSDK.
2) Create SDK instance
<script>
if (window.LoginRadiusSDK) {
const options = {
apiKey: 'YOUR_API_KEY',
callbackUrl: window.location.href.split('?')[0]
};
window.LRObject = new LoginRadiusSDK(options);
}
</script>
List of available options
| Option | Type | Required | Description | Example |
|---|---|---|---|---|
apiKey | string | Yes | LoginRadius API key. | 'ABC123XYZ' |
sott | string | Yes (registration) | Secure One‑Time Token for registration flows. | 'SOTT_TOKEN' |
verificationUrl | string | No | Redirect URL for email verification and magic links. | 'https://example.com/verify' |
resetPasswordUrl | string | No | Redirect URL for password reset flows. | 'https://example.com/reset' |
callbackUrl | string | No | Post‑auth callback URL (OAuth/SSO). | 'https://example.com/callback' |
styleName | string | No | Apply predefined UI style configured in Dashboard. | 'MyBrand' |
OtpLength | number | No | OTP length for passwordless flows (4–8). | 6 |
OtpType | string | No | OTP type. | 'NUMERIC' or 'ALPHANUMERIC' |
developmentMode | boolean | No | Enable development mode for debugging. | false |
passwordlessLoginEmailTemplate | string | No | Custom email template for passwordless login. | 'passwordless-template' |
callbackInsideSameWindow | boolean | No | Keep auth flow in same window/tab. | true |
callbackType | string | No | Callback response type. | 'token' |
scope | string | No | OAuth scopes to request. | 'profile email' |
loginUrl | string | No | Custom login endpoint. | 'https://example.com/login' |
deleteUrl | string | No | Custom account-deletion endpoint. | 'https://example.com/delete' |
emailTemplate | string | No | Default email template name. | 'default' |
resetpinurl | string | No | Redirect URL for PIN reset. | 'https://example.com/resetpin' |
verificationEmailTemplate | string | No | Email template for verification. | 'verify-template' |
resetPasswordEmailTemplate | string | No | Email template for password reset. | 'resetpwd-template' |
resetPassKeyEmailTemplate | string | No | Email template for reset passkey. | 'resetkey-template' |
resetPINEmailTemplate | string | No | Email template for PIN reset. | 'resetpin-template' |
resetPasswordConfirmationEmailTemplate | string | No | Confirmation email template after password reset. | 'reset-confirm-template' |
resetPINConfirmationEmailTemplate | string | No | Confirmation email template after PIN reset. | 'resetpin-confirm-template' |
smartLoginRedirectUrl | string | No | Redirect after smart login. | 'https://example.com/smart' |
autoLoginRedirectUrl | string | No | Redirect after auto-login. | 'https://example.com/autologin' |
smartLoginEmailTemplate | string | No | Email template for smart login. | 'smart-template' |
autoLoginEmailTemplate | string | No | Email template for auto-login. | 'autologin-template' |
smsTemplate2FA | string | No | SMS template for 2FA. | '2fa-sms' |
smsTemplateForgot | string | No | SMS template for forgot password. | 'forgot-sms' |
smsTemplateWelcome | string | No | SMS template for welcome message. | 'welcome-sms' |
smsTemplateOneTouchLoginWelcome | string | No | SMS template for one-touch welcome. | 'onetouch-welcome-sms' |
smsTemplateOneTouchLogin | string | No | SMS template for one-touch login. | 'onetouch-sms' |
passwordlessLoginSMSTemplate | string | No | SMS template for passwordless login. | 'pwdless-sms' |
smsTemplate2FAWelcome | string | No | SMS template for 2FA welcome. | '2fa-welcome-sms' |
smsTemplatePhoneVerification | string | No | SMS template for phone verification. | 'phone-verify-sms' |
smsTemplateUpdatePhone | string | No | SMS template for phone update. | 'update-phone-sms' |
welcomeEmailTemplate | string | No | Welcome email template. | 'welcome-template' |
onetouchLoginEmailTemplate | string | No | One-touch login email template. | 'onetouch-email' |
deleteUserEmailTemplate | string | No | Account deletion email template. | 'delete-template' |
onetouchLoginRedirectUrl | string | No | Redirect after one-touch login. | 'https://example.com/onetouch' |
resetPassKeyUrl | string | No | Redirect URL for reset passkey. | 'https://example.com/resetkey' |
resetPINUrl | string | No | Redirect URL for PIN reset. | 'https://example.com/resetpin' |
templateName | string | No | Legacy template name override. | 'legacy' |
debugMode | boolean | No | Enable debug logging. | false |
tokenType | string | No | Token type returned. | 'lrtoken' |
integrationName | string | No | Integration identifier. | 'my-integration' |
smartLoginPingCount | number | No | Max pings for smart login. | 100 |
smartLoginPingInterval | number | No | Ping interval (seconds) for smart login. | 5 |
crossDeviceSSOPingCount | number | No | Max pings for cross-device SSO. | 100 |
crossDeviceSSOPingInterval | number | No | Ping interval (seconds) for cross-device SSO. | 5 |
maskSensitiveInput | boolean | No | Mask sensitive input fields. | false |
enableHeaderSott | boolean | No | Include SOTT in request headers. | true |
accessTokenResponse | boolean | No | Return access token in response. | true |
rbaOneclickEmailTemplate | string | No | Risk-based auth one-click email template. | 'rba-oneclick' |
rbaOTPSmsTemplate | string | No | Risk-based auth OTP SMS template. | 'rba-otp-sms' |
rbaCityEmailTemplate | string | No | Risk-based auth city change email template. | 'rba-city-email' |
rbaCountryEmailTemplate | string | No | Risk-based auth country change email template. | 'rba-country-email' |
rbaBrowserEmailTemplate | string | No | Risk-based auth browser change email template. | 'rba-browser-email' |
rbaIpEmailTemplate | string | No | Risk-based auth IP change email template. | 'rba-ip-email' |
rbaDeviceEmailTemplate | string | No | Risk-based auth device change email template. | 'rba-device-email' |
rbaCitySmsTemplate | string | No | Risk-based auth city change SMS template. | 'rba-city-sms' |
rbaCountrySmsTemplate | string | No | Risk-based auth country change SMS template. | 'rba-country-sms' |
rbaBrowserSmsTemplate | string | No | Risk-based auth browser change SMS template. | 'rba-browser-sms' |
rbaIpSmsTemplate | string | No | Risk-based auth IP change SMS template. | 'rba-ip-sms' |
rbaDeviceSmsTemplate | string | No | Risk-based auth device change SMS template. | 'rba-device-sms' |
setLRSession | boolean | No | Set LoginRadius session cookie. | false |
askOptionalFieldsOnProgressiveSteps | boolean | No | Prompt optional fields progressively. | true |
disableResendOTPButton | boolean | No | Disable resend OTP button. | false |
disableResendOTPButtonDelay | number | No | Delay (seconds) before enabling resend OTP. | 5 |
EmailTemplate2FA | string | No | Email template for 2FA. | '2fa-email' |
authenticatorOptionsOrder | array | No | Ordered list of 2FA authenticators. | ['emailotp','securityquestion','auth','sms','pushnotification','duomfa','passkey'] |
v2RecaptchaSiteKey | string | No | Google reCAPTCHA v2 site key. | 'recaptcha-v2-key' |
v3RecaptchaSiteKey | string | No | Google reCAPTCHA v3 site key. | 'recaptcha-v3-key' |
organizationObj | object | No | Organization object for B2B features. | { id: 'org_123' } |
isB2BEnabled | boolean | No | Enable B2B/organization features. | false |
securityQuestionEnabled | boolean | No | Enable security question features. | false |
appName | string | No | Application name. | 'MyApp' |
brandName | string | No | Brand name override. | 'MyBrand' |
styleConfig | object | No | Override style configuration. | { ... } |
projectionFields | array | No | Fields to include in profile responses. | ['Email','FullName'] |
localization | boolean | No | Enable built‑in localization. | false |
RegistrationFormSchema | array | No | Registration form fields schema. | [{ name: 'Email' }] |
loginLockedType | string | No | Login lockout mode. | 'None' |
SecurityQuestions | array | No | Allowed security questions. | ['Question1','Question2'] |
securityQuestionsCount | number | No | Required number of security questions. | 2 |
otpEmailVerification | boolean | No | Use email OTP for verification. | false |
passwordLength | object | No | Password length limits. | { min: 8, max: 64 } |
SocialSchema | object | No | Social profile mapping schema. | { ... } |
noCallbackForSocialLogin | boolean | No | Disable callback after social login. | false |
noCallback | boolean | No | Disable callback redirects. | false |
encryptedAnswer | boolean | No | Encrypt security question answers. | true |
optionalTwoFactorAuthentication | boolean | No | Offer optional 2FA. | false |
twoFactorAuthentication | boolean | No | Require 2FA. | false |
qrCodeAuthentication | boolean | No | Enable QR code authentication. | false |
googleAuthentication | boolean | No | Enable Google Authenticator. | false |
emailOTPAuthentication | boolean | No | Enable Email OTP authentication. | false |
pushNotificationAuthenticator | boolean | No | Enable push notification authenticator. | false |
securityQuestionAuthentication | boolean | No | Enable security question authenticator. | false |
smsOTPAuthentication | boolean | No | Enable SMS OTP authenticator. | false |
duoAuthentication | boolean | No | Enable Duo MFA authenticator. | false |
passkeyAuthenticator | boolean | No | Enable Passkey authenticator. | false |
phoneLogin | boolean | No | Allow login with phone. | false |
duplicateEmailWithUniqueUsername | boolean | No | Allow duplicate email with unique username. | false |
passwordlessLoginOTP | boolean | No | Enable passwordless OTP login. | false |
instantOTPLogin | boolean | No | Enable instant OTP login. | false |
optionalEmailVerification | boolean | No | Make email verification optional. | false |
disabledEmailVerification | boolean | No | Disable email verification. | false |
loginOnEmailVerification | boolean | No | Auto‑login after email verification. | false |
passwordlessLogin | boolean | No | Enable passwordless login flows. | false |
instantLinkLogin | boolean | No | Enable instant link login. | false |
askRequiredFieldForTraditionalLogin | boolean | No | Prompt required fields during login. | false |
stayLogin | boolean | No | Enable "stay logged in" option. | false |
disableSignup | boolean | No | Disable user registration. | false |
riskBasedAuthentication | boolean | No | Enable risk‑based authentication. | false |
usernameLogin | boolean | No | Allow username‑based login. | false |
promptPasswordOnSocialLogin | boolean | No | Require password after social login. | false |
askOptionalFieldsOnRegistration | boolean | No | Prompt optional fields on registration. | false |
askEmailForUnverifiedProfileAlways | boolean | No | Always prompt email for unverified profiles. | false |
logoutOnVerifyEmail | boolean | No | Log out after email verification. | false |
disableAccountLinking | boolean | No | Disable account linking. | false |
customDomain | string | No | Hosted Pages custom domain. | 'login.example.com' |
apiCustomDomain | string | No | API custom domain. | 'api.example.com' |
privacyPolicyConfiguration | object | No | Privacy policy configuration. | { ... } |
isConsentManagementEnabled | boolean | No | Enable consent management. | false |
loginOnPasswordReset | boolean | No | Auto‑login after password reset. | false |
optionalRecaptchaConfiguration | object | No | Optional captcha configuration. | { ... } |
isVoiceOtp | boolean | No | Enable voice OTP. | false |
v2Recaptcha | boolean | No | Use reCAPTCHA v2. | false |
invisibleRecaptcha | boolean | No | Use invisible reCAPTCHA. | false |
isCaptchaEnabled | boolean | No | Enable captcha protection. | false |
tencentCaptchaAppid | string | No | Tencent Captcha App ID. | '123456' |
tencentCaptcha | boolean | No | Enable Tencent Captcha. | false |
hCaptchaSiteKey | string | No | hCaptcha site key. | 'hcaptcha-key' |
captchaTheme | string | No | Captcha theme (light/dark). | 'light' |
isPassKeysEnabled | boolean | No | Enable Passkeys support. | false |
isPasskeyAutofill | boolean | No | Enable Passkey autofill. | false |
isPasskeyButton | boolean | No | Show Passkey login button. | false |
isPINAuthentication | boolean | No | Enable PIN authentication. | false |
PINConfiguration | object | No | PIN configuration settings. | { ... } |
templateVerificationTypes | object | No | Template verification types. | { ... } |
passkeyAuthentication | boolean | No | Enable Passkey authentication. | false |
pushNotificationAuthentication | boolean | No | Enable push notification authentication. | false |
displayPasswordStrength | boolean | No | Show password strength meter. | false |
contactusUrl | string | No | Contact‑us page URL. | 'https://example.com/contact' |
pinSchema | array | No | PIN form schema. | [{ name: 'PIN' }] |
isMobile | boolean | No | Hint for mobile view/behavior. | false |
customizeSocialPopup | string | No | Customize social login popup. | '{...}' |
isCustomScope | boolean | No | Use custom OAuth scopes. | false |
clientId | string | No | Workflow client ID. | 'wf-client-id' |
brand | string | No | Workflow brand name. | 'default' |
federationTokenCallback | string | No | Federation token callback URL. | 'https://example.com/fedcb' |
isAutoLookupEnabled | boolean | No | Enable auto lookup. | false |
isMultiCustomDomainBrandingEnabled | boolean | No | Enable multi custom domain branding. | false |
3) Render a component
<div id="auth-container"></div>
<script>
const auth = { container: 'auth-container', onSuccess: console.log, onError: console.error };
LRObject.init('auth', auth);
</script>
4) Hooks (non-localization)
Register hooks before calling init.
LRObject.$hooks.call('formValidationRules', {
emailid: 'required|valid_email',
password: 'required|min_length[8]'
});
LRObject.$hooks.call('startProcess', function (name) {
console.log('Start', name);
});
LRObject.$hooks.call('endProcess', function (name) {
console.log('End', name);
});
When to Use
- You’re customizing Hosted Pages V3’s behavior or validation
- You need code-driven control beyond the Design Tab
- You’re migrating from V2 and want streamlined hooks
Notes
- Localization is managed in Hosted Pages UI; skip custom locale hooks here
- Register hooks before calling
LRObject.initto ensure they apply
Related Resources
- Hosted Pages Overview: /deployment/hosted-pages/overview/
- Hosted Pages Customization: /deployment/hosted-pages/customization/
- Start with AI: /deployment/hosted-pages/start-with-AI/