---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# `Auto`

Enumerator options for [`imageOptimizerOptions.auto`](./imageOptimizerOptions.mdx).

## Constants

- `AVIF` (`"avif"`) If the browser's Accept header indicates compatibility, deliver an AVIF image.
- `WEBP` (`"webp"`)	If the browser's Accept header indicates compatibility, deliver a WebP image.

## Examples

```js
import { Auto, Region } from 'fastly:image-optimizer';

addEventListener("fetch", (event) => event.respondWith(handleRequest(event)));

async function handleRequest(event) {
  return await fetch('https://www.w3.org/Graphics/PNG/text2.png', {
    imageOptimizerOptions: {
      region: Region.UsEast,
      auto: Auto.AVIF
    },
    backend: 'w3'
  });
}
```