The Consent screen is a crucial component that handles user privacy acknowledgment and data collection permissions. It displays your organization’s privacy policy and captures user consent before proceeding with onboarding.
Quick Implementation
Initialize Component
const consent = oneSdk . component ( 'form' , {
name: "CONSENT" ,
type: "manual"
});
consent . mount ( "#form" );
Event Handling
Loading Event (form:consent:loaded) Screen mounted successfully consent . on ( 'form:consent:loaded' , () => {
console . log ( 'Consent screen mounted successfully' );
});
Interaction Event (form:consent:ready) User provided consent consent . on ( 'form:consent:ready' , () => {
// User has provided consent - proceed to next step
personal . mount ( "#form" );
});
Error Handling (form:consent:failed) Screen failed to load consent . on ( 'form:consent:failed' , ( error ) => {
console . error ( 'Consent screen failed:' , error );
// Implement your error handling logic
});
Customization Options
Basic Configuration
Advanced Configuration
const consent = oneSdk . component ( 'form' , {
name: "CONSENT" ,
type: "manual" ,
title: {
label: "Your consent matters to us" ,
style: { 'ff-title' : { color: '#2C3E50' } }
},
cta: {
label: 'I Agree' ,
style: { 'ff-button' : { backgroundColor: '#27AE60' } }
}
});
const consent = oneSdk . component ( 'form' , {
name: "CONSENT" ,
type: "manual" ,
title: {
label: "Your consent matters to us" ,
style: { 'ff-title' : { /* custom styles */ } }
},
descriptions: [
{
label: 'We collect your data to verify your identity' ,
style: { 'ff-description' : { fontSize: '16px' } }
},
{
label: 'Your information is protected by our privacy policy' ,
style: { 'ff-description' : { fontSize: '16px' } }
}
],
checkbox: {
label: "Consent Acknowledgment" ,
content: [
{ label: "I have read and agree to the privacy policy" },
{ label: "I consent to the collection of my personal information" }
]
},
cta: {
label: 'Continue' ,
style: { 'ff-button' : { /* custom styles */ } }
}
});
Customizable Elements
title : {
label : "Your consent matters to us" ,
style : {
'ff-title' : {
fontSize: '24px' ,
fontWeight: 'bold' ,
color: '#2C3E50'
}
}
}
Description Configuration
descriptions : [
{
label: 'We need to collect your data for verification' ,
style: {
'ff-description' : {
marginBottom: '1rem' ,
lineHeight: '1.5'
}
}
}
]
checkbox : {
label : "User Agreement" ,
style : { 'ff-instructions' : { /* styles */ } },
content : [
{ label: "I agree to the terms and conditions" },
{ label: "I consent to data collection" }
]
}
Best Practices
Always maintain clear and concise consent language
Ensure checkbox labels accurately reflect what users are agreeing to
Consider implementing multiple language support for international users
Test the consent flow thoroughly in your development environment
Remember to comply with relevant privacy regulations (GDPR, CCPA, etc.) when customizing consent text and checkboxes.