Skip to main content
function signInWithSiwe(options: SignInWithSiweOptions): Promise<SignInWithSiweResult>;
Initiates the Sign In With Ethereum (SIWE/EIP-4361) authentication flow. The server returns a pre-formatted SIWE message for the end user to sign with their Ethereum wallet. Pass the resulting flowId and the wallet signature to verifySiweSignature to complete sign-in.

Parameters

ParameterTypeDescription
optionsSignInWithSiweOptionsThe options for the sign in.

Returns

Promise<SignInWithSiweResult> The result of the sign in, including the SIWE message to sign.

Example

const result = await signInWithSiwe({
  address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  chainId: 1,
  domain: "example.com",
  uri: "https://example.com",
});
// Sign result.message with the user's wallet, then call verifySiweSignature