> ## Documentation Index
> Fetch the complete documentation index at: https://auth0.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PendingConsent

> Describes all the hooks and methods available to customize the Universal Login `pending-consent` screen.

The `pending-consent` screen is a waiting room displayed during Rich Authorization Requests (RAR) flows when no `customized-consent` prompt is configured. The user approves or denies the request off-browser through the My Account experience while this screen polls for the outcome. Once the consent is resolved, you continue the flow and Auth0 applies the result.

![ACUL Pending Consent](https://mintlify.s3.us-west-1.amazonaws.com/auth0/docs/images/acul/pending-consent.png)

## Import

Each screen has its own set of hooks and methods. The SDK supports **partial import** and **root import** for each screen.

* Using partial import allows you to include only the code you need for your specific use case.
* Using root import allows you to load all screens from a single bundle, which is useful when you want a unified build to handle all possible screens.

```jsx Import Example theme={null}
// root import
import { usePendingConsent } from '@auth0/auth0-acul-react';

// partial import
import {
  usePendingConsent,
  // Context hooks
  useUser,
  useTenant,
  useBranding,
  useClient,
  useOrganization,
  usePrompt,
  useScreen,
  useTransaction,
  useUntrustedData,
  useExperiment,
  // Common hooks
  useCurrentScreen,
  useAuth0Themes,
  useErrors,
  useMfaPolling,
  // Utility hooks
  useChangeLanguage,
  // Methods
  continueMethod,
} from '@auth0/auth0-acul-react/pending-consent';

function PendingConsentScreen() {
  const { continue: continueFlow } = usePendingConsent();
  useMfaPolling({
    intervalMs: 5000,
    onCompleted: () => continueFlow(),
  });
  return <p>Waiting for your approval…</p>;
}
```

## Context Hooks

Screen-scoped hooks that provide read-only access to Auth0 context data on the `pending-consent` screen. Import them from `@auth0/auth0-acul-react/pending-consent`.

**useBranding** `() => [BrandingMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/BrandingMembers)`

This hook provides branding configurations, such as logo, colors, and theme settings displayed on the `pending-consent` screen.

```jsx Example theme={null}
import { useBranding } from '@auth0/auth0-acul-react/pending-consent';
function CustomTheme() {
  const branding = useBranding();
}
```

**useClient** `() => [ClientMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/ClientMembers)`

This hook provides client-related configurations, such as `id`, `name`, and `logoUrl`, for the `pending-consent` screen.

```jsx Example theme={null}
import { useClient } from '@auth0/auth0-acul-react/pending-consent';
function AppInfo() {
  const client = useClient();
}
```

**useExperiment** `() => [ExperimentMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/ExperimentMembers)`

This hook provides the active [Experiment Center](https://auth0.com/docs/customize/experiment-center) experiment for the `pending-consent` screen, or `null` when no experiment is active (or the screen has not opted in via `context_configuration`).

```jsx Example theme={null}
import { useExperiment } from '@auth0/auth0-acul-react/pending-consent';
function ExperimentBranch() {
  const experiment = useExperiment();
  if (!experiment) return null;
  return experiment.isControl ? <ControlUI /> : <TreatmentUI />;
}
```

**useOrganization** `() => [OrganizationMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/OrganizationMembers)`

This hook provides information about the user's Organization, such as `id` and `name`. Returns `null` when no Organization context is present.

```jsx Example theme={null}
import { useOrganization } from '@auth0/auth0-acul-react/pending-consent';
function OrgSelector() {
  const organization = useOrganization();
  if (!organization) {
    return <p>No Organization context</p>;
  }
}
```

**usePrompt** `() => [PromptMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/PromptMembers)`

This hook contains data about the current prompt in the authentication flow.

```jsx Example theme={null}
import { usePrompt } from '@auth0/auth0-acul-react/pending-consent';
function FlowInfo() {
  const prompt = usePrompt();
}
```

**useScreen** `() => [ScreenMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/ScreenMembers)`

This hook contains details specific to the `pending-consent` screen, including its configuration and context.

```jsx Example theme={null}
import { useScreen } from '@auth0/auth0-acul-react/pending-consent';
function ScreenDebug() {
  const screen = useScreen();
}
```

**useTenant** `() => [TenantMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/TenantMembers)`

This hook contains data related to the tenant, such as `id` and associated metadata.

```jsx Example theme={null}
import { useTenant } from '@auth0/auth0-acul-react/pending-consent';
function TenantInfo() {
  const tenant = useTenant();
}
```

**useTransaction** `() => [TransactionMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/TransactionMembers)`

This hook provides transaction-specific data for the `pending-consent` screen, such as the transaction `state` and any errors.

```jsx Example theme={null}
import { useTransaction } from '@auth0/auth0-acul-react/pending-consent';
function TransactionInfo() {
  const transaction = useTransaction();
}
```

**useUntrustedData** `() => [UntrustedDataMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/UntrustedDataMembers)`

This hook handles untrusted data passed to the screen, such as prefilled parameters from URL query strings.

```jsx Example theme={null}
import { useUntrustedData } from '@auth0/auth0-acul-react/pending-consent';
function PrefilledForm() {
  const untrustedData = useUntrustedData();
}
```

**useUser** `() => [UserMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/UserMembers)`

This hook provides details of the active user, including `username`, `email`, and available authentication methods.

```jsx Example theme={null}
import { useUser } from '@auth0/auth0-acul-react/pending-consent';
function UserProfile() {
  const user = useUser();
}
```

**usePendingConsent** `[PendingConsentMembers](/docs/libraries/acul/react-sdk/API-Reference/Types/interfaces/PendingConsentMembers)`

This hook returns all methods and context available on the `pending-consent` screen.

## Methods

**continueMethod** `Promise\<void\>`

Continues the flow after the user approves or denies the consent off-browser. Auth0 applies the outcome, so there are no separate accept or deny methods. If the consent is still pending, Auth0 renders this screen again.

```jsx Example theme={null}
import { usePendingConsent } from '@auth0/auth0-acul-react/pending-consent';

function ContinueButton() {
  const { continue: continueFlow } = usePendingConsent();
  return (
    <button onClick={() => continueFlow()}>
      Try again
    </button>
  );
}
```

## Common/Utility Hooks

**[useMfaPolling](https://auth0.com/docs/libraries/acul/react-sdk/API-Reference/Hooks/useMfaPolling.md)** `Hooks`

Manages polling state for screens that wait on an out-of-band decision. On this screen, `onCompleted` runs when the user approves or denies the consent. Call `continue()` from it to advance the flow.

```jsx Example theme={null}
import { useMfaPolling, usePendingConsent } from '@auth0/auth0-acul-react/pending-consent';

function ConsentStatus() {
  const { continue: continueFlow } = usePendingConsent();
  const { isRunning, startPolling, stopPolling } = useMfaPolling({
    intervalMs: 5000,
    onCompleted: () => continueFlow(),
    onError: (error) => console.error('Polling error:', error),
  });

  useEffect(() => {
    startPolling();
    return () => stopPolling();
  }, []);

  return isRunning ? <p>Waiting for your approval…</p> : null;
}
```

Polling stops after an error. Offer a manual fallback, such as a "Try again" button that calls `continue()`, and hide the button while polling runs.

**[useAuth0Themes](https://auth0.com/docs/libraries/acul/react-sdk/API-Reference/Hooks/useAuth0Themes.md)** `Hooks`

This hook gets the current theme options with flattened configuration from branding context.

**[useChangeLanguage](https://auth0.com/docs/libraries/acul/react-sdk/API-Reference/Hooks/useChangeLanguage)** `Hooks`

This hook returns a function for changing the display language on the current ACUL screen.

**[useCurrentScreen](https://auth0.com/docs/libraries/acul/react-sdk/API-Reference/Hooks/useCurrentScreen.md)** `Hooks`

This hook gets the current screen context and state.

**[useErrors](https://auth0.com/docs/libraries/acul/react-sdk/API-Reference/Hooks/useErrors.md)** `Hooks`

This hook reads and manages server, client, and developer errors on the screen.
