# useSignTypedData | @account-kit/react

> Overview of the useSignTypedData 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 useSignTypedData(args): UseSignTypedDataResult;
```

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

Similar to `useSignMessage`, [hook](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useSignTypedData.ts) for signing typed data, supporting both connected accounts and clients in EIP 712 format.

Uses `eth_signTypedData` to sign structured, typed data. Accepts typed, complex data structures as input. Like `useSignMessage`, this hook also handles deployed (1271) and undeployed accounts (6492).

## Example

```ts twoslash
import { useSignTypedData, useSmartAccountClient } from "@account-kit/react";
const typedData = {
  types: {
    Message: [{ name: "content", type: "string" }],
  },
  primaryType: "Message",
  message: { content: "Hello" },
};
const { client } = useSmartAccountClient({});
const {
  signTypedData,
  signTypedDataAsync,
  signedTypedData,
  isSigningTypedData,
  error,
} = useSignTypedData({
  client,
  // these are optional
  onSuccess: (result) => {
    // do something on success
  },
  onError: (error) => console.error(error),
});

const result = await signTypedData({ typedData });
```

## Parameters

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

  <tbody>
    <tr>
      <td>
        `args`
      </td>

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

      <td>
        The arguments for the hook, including client and mutation-related arguments. [ref](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useSignTypedData.ts#L24)
      </td>
    </tr>

  </tbody>
</table>

## Returns

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

An object containing methods and state related to the sign typed data mutation process. [ref](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useSignTypedData.ts#L28)