Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs-staging-quickstart-revamp.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

The Customized Consent screen class provides methods associated with the customized consent screen.
Import and instantiate the Customized Consent screen class:
import CustomizedConsent from '@auth0/auth0-acul-js/customized-consent';
const customizedconsentManager = new CustomizedConsent();

Properties

The Customized Consent screen class properties are:
interface branding {
  settings: null | BrandingSettings;
  themes: null | BrandingThemes;
}

interface BrandingSettings {
  colors?: {
    pageBackground?: string | {
      angleDeg: number;
      end: string;
      start: string;
      type: string;
    };
    primary?: string;
  };
  faviconUrl?: string;
  font?: {url: string;};
  logoUrl?: string;
}

interface BrandingThemes {
  default: {
    borders: Record<string, string | number | boolean>;
    colors: Record<string, string>;
    displayName: string;
    fonts: Record<string, string | boolean | object>;
    pageBackground: Record<string, string>;
    widget: Record<string, string | number>;
  };
}

Methods

The Customized Consent screen class methods are:

accept( options? )

This method submits the user’s decision to accept the requested permissions.
import CustomizedConsent from '@auth0/auth0-acul-js/customized-consent';
const customizedConsentManager = new CustomizedConsent();
const handleAccept = async () => {
 try {
   await customizedConsentManager.accept();
   console.log('Consent accepted successfully.');
 } catch (err) {
   console.error('Error accepting consent:', err);
 }
};
Parameter                 TypeRequiredDescription
[key: string]string | number | boolean | undefinedNoOptional data collected from user.

deny( options? )

This method submits the user’s decision to deny the requested permissions.
import CustomizedConsent from '@auth0/auth0-acul-js/customized-consent';
const customizedConsentManager = new CustomizedConsent();
const handleDeny = async () => {
try {
    await customizedConsentManager.deny({ denial_reason: "user_declined" });
    // On success, Auth0 will typically redirect.
  } catch (e) {
    console.error('Failed to deny consent:', e);
  }
 }
Parameter                 TypeRequiredDescription
[key: string]string | number | boolean | undefinedNoOptional data collected from user.

getError( options? )

This method retrieves the array of transaction errors from context or an empty array if none exist.
import CustomizedConsent from '@auth0/auth0-acul-js/customized-consent';
    const customizedConsentManager = new CustomizedConsent();
    await customizedConsentManager.getError();