c15t
/
C15T Logo
Select a framework
Frameworks
Welcome to c15t Docs
Introduction to Consent Management (c15t)
AI Tools Integrations
OSS
Contributing to c15t.com
License
Building Privacy Tools in the Open
Legal
Cookie Policy
Privacy Policy
C15T Logo
HomeFrontendIntegrationsSelf HostChangelog
xbskydiscordgithub1.4k
c15t
/
C15T Logo
Select a framework
Frameworks
Welcome to c15t Docs
Introduction to Consent Management (c15t)
AI Tools Integrations
OSS
Contributing to c15t.com
License
Building Privacy Tools in the Open
Legal
Cookie Policy
Privacy Policy
home-2Docs
chevron-rightFrameworks
chevron-rightReact
chevron-rightHooks
chevron-rightUse-consent-manager
chevron-rightSetting-consent

Setting consent

Learn how to manage a user's consent

setSelectedConsent()

This method sets a user's consent choice but doesn't save it.

setSelectedConsent('marketing', true) 

saveConsents()

This method should be called after the user saves their consent preferences, e.g., via an 'Accept all' button or a dialog save. This function handles logic such as calling the backend and the onConsentSet callback.

saveConsents('all') // User has accepted to all
saveConsents('custom') // Uses the consents set by setSelectedConsent()
saveConsents('necessary') // User rejects all 

setConsent()

Useful for buttons like "Enable Marketing Consent", this will save the user's new consent by calling saveConsents().

setConsent('marketing', true) 

Available in other SDKs

javascriptJavaScriptnextNext.js
C15T Logo
Leverage native React components for seamless integration and high performance in a robust Consent Management solution that empowers your development team while prioritizing privacy and compliance.
Product
  • Documentation
  • Components
Company
  • GitHub
  • Contact
Legal
  • Privacy Policy
  • Cookie Policy
c15t