# useGrantPermissions | @account-kit/react

> Overview of the useGrantPermissions hook from @account-kit/react

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
function useGrantPermissions(params): UseGrantPermissionsResult;
```

Defined in: [account-kit/react/src/hooks/useGrantPermissions.ts:98](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useGrantPermissions.ts#L98)

React hook for granting permissions on the smart account to a given keypair
This enables dapps to request specific permissions from smart accounts, such as spending limits or execution permissions.
Returns an error if called with an EOA wallet connection.

## Example

```tsx twoslash
import { useGrantPermissions, useSmartAccountClient } from "@account-kit/react";

function PermissionsComponent() {
  const { client } = useSmartAccountClient({});
  const { grantPermissions, isGrantingPermissions } = useGrantPermissions({
    client,
  });

  const handleGrantPermissions = () => {
    grantPermissions({
      permissions: [
        {
          type: "native-token-spending-limit",
          data: {
            amount: "1000000000000000000", // 1 ETH in wei
          },
        },
      ],
      expiry: Math.floor(Date.now() / 1000) + 3600, // 1 hour from now
    });
  };

  return (
    <button onClick={handleGrantPermissions} disabled={isGrantingPermissions}>
      {isGrantingPermissions ? "Granting..." : "Grant Permissions"}
    </button>
  );
}
```

## Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `params`
      </td>

      <td>
        [`UseGrantPermissionsParams`](../type-aliases/UseGrantPermissionsParams)
      </td>

      <td>
        Configuration object containing the smart account client
      </td>
    </tr>

  </tbody>
</table>

## Returns

[`UseGrantPermissionsResult`](../type-aliases/UseGrantPermissionsResult)

Object containing mutation functions, loading state, result, and error