# webln.signMessage()

Request that the user signs an arbitrary string message.&#x20;

Signed messages can either be verified server-side using the LND RPC method, or by clients with [webln.verifyMessage](https://webln.dev/#/api/verify-message).

#### Method

```typescript
async function signMessage(message: string): SignMessageResponse;
```

#### Response

```typescript
interface SignMessageResponse {
  message: string;
  signature: string;
}
```

#### Code Example <a href="#demo" id="demo"></a>

```typescript
await webln.enable();
await webln.signMessage("Sample message"); 
```

#### Demo

{% embed url="<https://codepen.io/getalby/pen/eYyXQNQ>" %}

**Example in the wild**

<https://amboss.space/> uses `webln.signMessage()`for login. Users sign a message and prove ownership of a lightning node.

&#x20;<img src="https://121660472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSHMrYyqxEldRs701vokD%2Fuploads%2FvbcBQlXX2cMH4P5Qsz1A%2Fchrome_g3QoEYiYL5.png?alt=media&#x26;token=3b804720-e782-4233-85df-a84337ad5905" alt="" data-size="original">
