# CesiumIonAuthPlugin

class in `3d-tiles-renderer/three/plugins`, extends `CesiumIonAuthPlugin`

```js
import { CesiumIonAuthPlugin } from '3d-tiles-renderer/three/plugins';
```

Plugin for authenticating requests to Cesium Ion. Handles token refresh, asset
endpoint resolution, and attribution collection. Auto-registration of terrain and
imagery plugins via `assetTypeHandler` is deprecated — provide a custom handler
instead.

Example: Loading a Cesium ion asset

```js
import { TilesRenderer } from '3d-tiles-renderer/three';
import { CesiumIonAuthPlugin } from '3d-tiles-renderer/three/plugins';

const tiles = new TilesRenderer();
tiles.registerPlugin( new CesiumIonAuthPlugin( {
	apiToken: 'YOUR_CESIUM_ION_TOKEN',
	assetId: '2275207',
	autoRefreshToken: true,
} ) );
```

## Constructor

```js
new CesiumIonAuthPlugin( options?: Object )
```

- `options`, `Object`, optional
  - `apiToken`, `string`, optional: Cesium Ion API token.
  - `assetId`, `string | null`, optional, default `null`: Cesium Ion asset ID, or `null` when using an explicit root URL.
  - `autoRefreshToken`, `boolean`, optional, default `false`: Automatically refresh the token on 4xx errors.
  - `useRecommendedSettings`, `boolean`, optional, default `true`: Apply recommended renderer settings for Cesium Ion assets.
  - `assetTypeHandler`, `function`, optional: Callback `(type, tiles, asset)` invoked for non-3DTILES asset types.
