# Sign In With Ethereum

import SiweCode from "/snippets/appkit/shared/siwe/code.mdx";
import SiweParams from "/snippets/appkit/shared/siwe/parameters.mdx";

<Warning>
**SIWE is being migrated to SIWX.** We recommend using [SIWX (Sign In With X)](/appkit/authentication/siwx/default) for new implementations as it provides multichain authentication support. For existing SIWE implementations, see the [migration guide](/appkit/authentication/siwx/default#migrating-from-siwe-to-siwx).
</Warning>

AppKit provides a simple solution for integrating with "Sign In With Ethereum" (SIWE), a new form of authentication that enables users to control their digital identity with their Ethereum account.
SIWE is a standard also known as [EIP-4361](https://docs.login.xyz/general-information/siwe-overview/eip-4361).

## One-Click Auth

**One-Click Auth** represents a key advancement within WalletConnect v2, streamlining the user authentication process in AppKit by enabling them to seamlessly connect with a wallet and sign a SIWE message with just one click.

It supports both [EIP-1271](https://eips.ethereum.org/EIPS/eip-1271), the standard for signature validation in smart accounts, and [EIP-6492](https://eips.ethereum.org/EIPS/eip-6492), which enables signature validation for smart accounts (contracts) that are not yet deployed, allowing messages to be signed without requiring prior deployment.

Connecting a wallet, proving control of an address with an off-chain signature, authorizing specific actions. These are the kinds of authorizations that can be encoded as ["ReCaps"](https://eips.ethereum.org/EIPS/eip-5573). ReCaps are permissions for a specific website or dapp that can be compactly encoded as a long string in the message you sign and translated by any wallet into a straight-forward one-sentence summary.
reown uses permissions expressed as ReCaps to enable a One-Click Authentication.

## Installation

<Tabs>
<Tab title="One-Click Auth">

<CodeGroup>

```bash npm
npm install @reown/appkit-siwe siwe viem
```

```bash Yarn
yarn add @reown/appkit-siwe siwe viem
```

```bash Bun
bun a @reown/appkit-siwe siwe viem
```

```bash pnpm
pnpm add @reown/appkit-siwe siwe viem
```
</CodeGroup>

</Tab>
<Tab title="Legacy">

<Warning>For a better UX we recommend using One-Click Auth.</Warning>

Install the AppKit SIWE package, additionally we also recommend installing [siwe](https://docs.login.xyz/) which will abstract a lot of the required logic.

<CodeGroup>

```bash npm
npm install @reown/appkit-siwe siwe
```

```bash Yarn
yarn add @reown/appkit-siwe siwe
```

```bash Bun
bun a @reown/appkit-siwe siwe
```

```bash pnpm
pnpm add @reown/appkit-siwe siwe
```
</CodeGroup>

</Tab>
</Tabs>

## Configure your SIWE Client

<Card
  title="React SIWE Example"
  icon="github"
  href="https://github.com/reown-com/appkit-web-examples/tree/main/react/react-siwe-server-example"
>
  Check the client/server React example
</Card>

<SiweCode />

## Initialize AppKit with your `siweConfig`

Add the `siweConfig` to your createAppKit parameters

```ts
// Pass your siweConfig inside the createAppKit() function
const modal = createAppKit({
  adapters: [wagmiAdapter], //or your Ethers adapter
  projectId,
  networks: [mainnet, arbitrum],
  defaultNetwork: mainnet,
  features: {
    analytics: true, // Optional - defaults to your Cloud configuration
  },
  siweConfig: siweConfig, // pass your siweConfig
});
```

## SIWE Config Parameters

<SiweParams />
