[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Task](https://evolu.dev/docs/api-reference/common/Task) › fetch

```ts
function fetch(
  input: RequestInfo | URL,
  init?: RequestInit,
): Task<Response, FetchError>;
```

Defined in: [packages/common/src/Task.ts:3806](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Task.ts#L3806)

Creates a [Task](https://evolu.dev/docs/api-reference/common/Task/type-aliases/Task) that wraps the native
[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).

Handles cross-browser abort behavior — WebKit throws a `DOMException` with
message "Fetch is aborted" instead of propagating `signal.reason`. This
helper normalizes the behavior to always return [AbortError](https://evolu.dev/docs/api-reference/common/Task/variables/AbortError).

### Example

```ts
await using run = createRun();

const result = await run(fetch("https://api.example.com/users"));

if (!result.ok) {
  // Handle FetchError or AbortError
}

// Compose with timeout and retry
const fetchWithRetry = (url: string) =>
  retry(timeout(fetch(url), "10s"), retryStrategyAws);
```