# Function: askToConnect()

```ts
function askToConnect(
   node, 
   space, 
   bot, 
   kind, 
   options?
): Promise<ConnectAsk>;
```

Defined in: [packages/core/src/schemas/connectors.ts:146](https://github.com/leifriksheim/minca/blob/main/core/src/schemas/connectors.ts#L146)

Writes a request to connect a bot to a service, or with `disconnect` to
disconnect it, for the bot's host to check. The secret it returns, 32
random bytes, is for the host's page alone: it is the only proof the
request is the asker's. The request stands for nine minutes.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `node` | [`P2PNode`](https://minca.dev/api/core/interfaces/P2PNode.md) |
| `space` | `string` |
| `bot` | `string` |
| `kind` | `string` |
| `options?` | \{ `disconnect?`: `boolean`; \} |
| `options.disconnect?` | `boolean` |

## Returns

`Promise`\<[`ConnectAsk`](https://minca.dev/api/schemas/interfaces/ConnectAsk.md)\>
