# Function: createClientAuth()

```ts
function createClientAuth(
   spaceId, 
   session, 
   read, 
   provider
): ClientAuth;
```

Defined in: [packages/core/src/network/peer-auth.ts:232](https://github.com/leifriksheim/minca/blob/main/core/src/network/peer-auth.ts#L232)

The client side. `spaceId` is bound into every signature, so a proof for one
space is useless in another; `read` is how it proves it may read a private
space (or just the read key, `deriveReadKey`), null in a public one.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `spaceId` | `string` |
| `session` | \{ `did`: `string`; `key`: `CryptoKey`; \} |
| `session.did` | `string` |
| `session.key` | `CryptoKey` |
| `read` | \| `ReadAccess` \| \{ `privateKey`: `CryptoKey`; \} \| `null` |
| `provider` | [`CryptoProvider`](https://minca.dev/api/core/interfaces/CryptoProvider.md) |

## Returns

[`ClientAuth`](https://minca.dev/api/core/interfaces/ClientAuth.md)
