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

> Prompt the user to sign a message with their wallet

# Sign message

<Frame>
  <img width="300" noZoom src="https://mintcdn.com/walletkit-docs/7aZXvKfTnGcrV8aq/images/connect_sign_message.png?fit=max&auto=format&n=7aZXvKfTnGcrV8aq&q=85&s=ffbad0e06fb91f764063a8bdd9053b63" data-path="images/connect_sign_message.png" />
</Frame>

WalletKit prompts the user with a modal that shows the message. The user can then review and sign the message using their 6-digit pin.

<CodeGroup>
  ```typescript React theme={null}
  import { useWalletKitLink } from "@walletkit/react-link";
  import { toHex } from "viem";

  function App() {
    const walletKit = useWalletKitLink();
    const [signature, setSignature] = useState("");

    const signMessage = async () => {
      const signature = await walletKit.signMessage(toHex("hello world"));
      setSignature(signature);
    };

    return (
      <div>
        <button onClick={() => signMessage()}>Sign Message</button>
        {signature ? <div>Signature: {signature}</div> : null}
      </div>
    );
  }
  ```

  ```typescript wagmi theme={null}
  import { useSignMessage } from "wagmi";

  function App() {
    const { data, isError, isLoading, isSuccess, signMessage } = useSignMessage({
      message: "hello world",
    });

    return (
      <div>
        <button disabled={isLoading} onClick={() => signMessage()}>
          Sign message
        </button>
        {isSuccess && <div>Signature: {data}</div>}
        {isError && <div>Error signing message</div>}
      </div>
    );
  }
  ```
</CodeGroup>
