> ## Documentation Index
> Fetch the complete documentation index at: https://docs.smokeball.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Auth

[**@smokeballdev/smokeball-client-sdk**](./../../../../README)

***

# Interface: Api

Entry point for auth to Smokeball.

## Methods

### connect()

> **connect**(`request`): `Promise`\<[`TokenSession`](./TokenSession)>

Establishes a new token session that can be used to generate fresh OAuth tokens.

#### Parameters

##### request

`ConnectRequest`

#### Returns

`Promise`\<[`TokenSession`](./TokenSession)>

a token session.

#### Example

```
const request: ConnectRequest = {
 jwt
};
const session = await sdk.auth.connect(request);
const token = await session.accessToken();
```

***

### ~~idToken()~~

> **idToken**(): `Promise`\<`string`>

#### Returns

`Promise`\<`string`>

the current id token.

#### Deprecated

Use connect() instead.

Retrieves the id token. This token can be used to access the api.

Only available to trusted clients.

#### Example

```
const token = await sdk.auth.idToken();
```

***

### ~~token()~~

> **token**(): `Promise`\<`string`>

#### Returns

`Promise`\<`string`>

the current access token.

#### Deprecated

Use connect() instead.

Retrieves the access token.

Only available to trusted clients.

#### Example

```
const token = await sdk.auth.token();
```
