> For the complete documentation index, see [llms.txt](https://dev.vulos.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.vulos.io/reference/identity-javascript-sdk/the-frontend-auth-package/frontendauth.md).

# FrontendAuth

{% hint style="info" %}
This class implements [`BaseAuth`](/reference/identity-javascript-sdk/the-base-package/authentication/baseauth.md).
{% endhint %}

## Members

### `client : any | null`

An implementation specific OpenID connect client.

## Interfaces

### `OpenIDTokenSet`

```typescript
interface OpenIDTokenSet {
    access_token: string,
    expires_at: number,
    token_type?: 'Bearer',
    id_token?: string,
    refresh_token?: string
}
```

## Methods

This class overrides previously defined methods from [`BaseAuth`](/reference/identity-javascript-sdk/the-base-package/authentication/baseauth.md).

### `async setRefreshTokenCallback(fn)`

This function sets a refresh callback implementation for this object.

The `fn` argument must be a function that takes a refresh token (string) as an argument and returns a promise that contains an object that implements the `OpenIDTokenSet` interface.

```javascript
import { IFrameRefresh } from '@vulos/identity-browser-sdk';

await auth.setRefreshTokenCallback(async function(refreshToken) {
    console.log(this) // this is the auth object
    if (refreshToken) {
        // refresh using a refresh token
    } else {
        throw new Error('Not supported')
    }
})
```

{% hint style="info" %}
An `iframe`-based implementation is provided as [`IFrameRefresh`](/reference/identity-javascript-sdk/the-frontend-auth-package/iframerefresh.md).
{% endhint %}
