> ## Documentation Index
> Fetch the complete documentation index at: https://acme-c84a37e5.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Start using Tryo in minutes

## Installation

Install Tryo using your favorite package manager:

<CodeGroup>
  ```bash npm theme={null}
  npm install tryo
  ```

  ```bash pnpm theme={null}
  pnpm add tryo
  ```

  ```bash yarn theme={null}
  yarn add tryo
  ```

  ```bash bun theme={null}
  bun add tryo
  ```
</CodeGroup>

## Basic Usage

Tryo provides a simple way to handle async operations safely.

### Using `run` directly

For simple use cases, you can use the `run` function directly:

```typescript theme={null}
import { run } from "tryo";

const result = await run(
  () => fetch("https://api.example.com/data").then((res) => res.json()),
  {
    retry: { maxRetries: 3, strategy: RetryStrategies.fixed(1000) },
    timeout: 5000,
  }
);

if (result.ok) {
  console.log("Success:", result.data);
} else {
  console.error("Failed:", result.error);
}
```

### Using `tryo`

For more advanced configurations and reuse, create a `Runner` instance:

```typescript theme={null}
import tryo from "tryo";

// Create a reusable runner with default configuration
const runner = tryo({
  retry: {
    maxRetries: 2,
    strategy: RetryStrategies.fixed(1000),
  },
  timeout: 10000,
  hooks: {
    onError: (error) => {
      console.error("Global error handler:", error);
    },
  },
});

// Use it across your application
const result = await runner.run(() => complexOperation());
```

## Next Steps

Now that you have Tryo installed, explore these key features:

<CardGroup cols={2}>
  <Card title="Error Handling" icon="shield-check" href="/concepts/error-handling">
    Learn how Tryo normalizes and handles errors.
  </Card>

  <Card title="Retry Logic" icon="arrows-rotate" href="/concepts/retry-logic">
    Configure smart retry strategies for your operations.
  </Card>

  <Card title="Concurrency" icon="layer-group" href="/concepts/concurrency">
    Run multiple tasks with controlled parallelism.
  </Card>

  <Card title="React Integration" icon="react" href="/examples/react">
    See how to use Tryo with React hooks.
  </Card>
</CardGroup>
