Skip to content

Documentation / react-auth / useSignMessage

Function: useSignMessage()

useSignMessage(callbacks?): Object

Use this hook to sign a message using the embedded wallet, and to attach callbacks for success and errors.

Parameters

callbacks?: Object

callbacks.onError?: (error) => void

Callback that will execute in the case of a non-successful signMessage.

ParamPrivyErrorCode - the corresponding error code

callbacks.onSuccess?: (params) => void

Callback that will execute once a successful signMessage completes. This will not run in the case of a wallet-based authentication or link flow.

Param the signature (type string) of the embedded wallet used to sign message

Returns

Object

signMessage - prompts the user to sign a message with their embedded wallet

signMessage

signMessage: (input, options?) => Promise<Object>

Parameters

input: Object

input.message: string

options?: Object

options.address?: string

options.uiOptions?: SignMessageModalUIOptions

Returns

Promise<Object>

signature

signature: string