# Installation

## Install

First of all the Aurelia Direct Router package needs to be installed. Open a command prompt in the root of your Aurelia application and run the command

```
npm i aurelia-direct-router
```

Once that's finished, you're all set up for using the `aurelia-direct-router` in your application.

## Register

To register the plugin in your application, you pass in the router object to the `register` method inside of the file containing your Aurelia initialization code (normally `main.ts`). Then import the `RouterConfiguration` class from the `aurelia-direct-router` package, which allows you to register the router and change configuration settings.

```typescript
import Aurelia from 'aurelia';
import { RouterConfiguration } from 'aurelia-direct-router';

Aurelia
  .register(RouterConfiguration)
  .app(component)
  .start();
```

## Use

Once the Aurelia Direct Router is installed and registered, simply import anything router related from `aurelia-direct-router` (instead of from `aurelia` or `@aurelia/router`).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jwx.gitbook.io/aurelia-direct-router/routing/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
