> 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-base-package/authentication/baseapi.md).

# BaseApi

## Interfaces

### `SuccessResponse`

```typescript
interface SuccessResponse {
    success: boolean,
    message: string
}
```

## Members

### `user :` [`User`](/reference/identity-javascript-sdk/the-base-package/authentication/user.md)

The `User` that this API is associated with.

### `apiUrl : string`

The base URL of this API.

## Methods

### `constructor(user, apiUrl)`

This should only get called by classes that inherit the `BaseApi` class.

* `user` should be an instance of the [`User`](/reference/identity-javascript-sdk/the-base-package/authentication/user.md) object.
* `apiUrl` should be the base API URL.

```javascript
class SomeVulosIdentityApi extends BaseApi {
    constructor(user, endpoint) {
        super(user, endpoint + '/api/v1/some_api')
    }
}

const someApi = new SomeVulosIdentityApi(user, endpoint)
```

### `async request(url, method = 'get', data = null, cachePrefix = null)`

Preform an authenticated request to the API.

```javascript
const response = await someApi.request('endpoint', 'put', { key: 'value' }, 'some:endpoint')
```
