---
title: useRequestScopesConsent
description: >-
  Returns an object with a scope consent request helper for scopes declared in
  your Mini's manifest.
source_url:
  html: 'https://shopify.dev/docs/api/shop-minis/hooks/util/userequestscopesconsent'
  md: >-
    https://shopify.dev/docs/api/shop-minis/hooks/util/userequestscopesconsent.md
api_name: shop-minis
---

# useRequestScopesConsent

The `useRequestScopesConsent` hook returns an object with a `requestScopesConsent()` function that shows the consent sheet for scopes declared in your Mini's [`manifest.json`](https://shopify.dev/docs/api/shop-minis/manifest-file). Use `requestScopesConsent()` when `useCheckScopesConsent` reports a `partially_granted` or `not_granted` status, and you want to let the user grant access again.

After the request resolves, call `refetch()` from `useCheckScopesConsent` to read the updated status. If another consent or permission sheet is already showing, or if the Mini's scope state hasn't loaded yet, then the request rejects with `request_blocked`.

## use​Request​Scopes​Consent()

### Returns

* **UseRequestScopesConsentReturns**

### UseRequestScopesConsentReturns

* requestScopesConsent

  Programmatically show the consent sheet for the Mini's required scopes. The sheet will show even if the user previously rejected it in the same session. Use this to build retry UX (e.g., a "Connect account" button). Resolves with \`{granted: boolean}\`. Rejects with \`'request\_blocked'\` if the request can't be served right now — either another consent or permission sheet is already showing, or the Mini's scope state hasn't finished loading yet. Call \`refetch()\` on \`useCheckScopesConsent\` after resolution to get the updated scope status.

  ```ts
  () => Promise<RequestScopesConsentResponse>
  ```

### RequestScopesConsentResponse

* granted

  ```ts
  boolean
  ```

Examples

### Examples

* ####

  ##### tsx

  ```tsx
  import {useCallback} from 'react'

  import {
    Button,
    useCheckScopesConsent,
    useRequestScopesConsent,
  } from '@shopify/shop-minis-react'

  export default function ReconnectBanner() {
    const {status, refetch} = useCheckScopesConsent()
    const {requestScopesConsent} = useRequestScopesConsent()

    const handleReconnect = useCallback(async () => {
      try {
        const {granted} = await requestScopesConsent()
        await refetch()

        console.log(granted ? 'Access granted' : 'Access not granted')
      } catch (requestError) {
        console.error('Could not request scope consent:', requestError)
      }
    }, [refetch, requestScopesConsent])

    if (status !== 'partially_granted' && status !== 'not_granted') {
      return null
    }

    return (
      <div>
        <p>Grant access to unlock the full experience.</p>
        <Button onClick={handleReconnect}>Grant access</Button>
      </div>
    )
  }
  ```

***

## Related

[- useCheckScopesConsent](https://shopify.dev/docs/api/shop-minis/hooks/util/usecheckscopesconsent)

[- Scopes consent](https://shopify.dev/docs/api/shop-minis/scopes-consent)

[- Manifest](https://shopify.dev/docs/api/shop-minis/manifest-file)

***
