# Bundle Installation

This framework provides a Symfony bundle that will help you to use the components within your Symfony application.

{% hint style="info" %}
Implementations for other frameworks and web applications exist.

As an example if you use Laravel, you may be interested in [this project: https://github.com/asbiin/laravel-webauthn](https://github.com/asbiin/laravel-webauthn)
{% endhint %}

## Installation

### With Symfony Flex

```shell
composer require web-auth/webauthn-symfony-bundle
```

{% hint style="info" %}
As the recipes are third party ones not officially supported by Symfony, you will be asked to execute the recipe or not. When applied, the recipes will prompt a message such as `WebAuthn Framework is ready.`
{% endhint %}

### Without Symfony Flex

If you don't use Symfony Flex, you must register the bundle and route manually.

{% code title="config/bundles.php" lineNumbers="true" %}

```php
<?php

return [
    //...
    Webauthn\Bundle\WebauthnBundle::class => ['all' => true],
];
```

{% endcode %}

{% code title="config/routes/webauthn.php" lineNumbers="true" %}

```php
<?php

declare(strict_types=1);

use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;

return function (RoutingConfigurator $routes) {
    $routes->import('.', 'webauthn');
};
```

{% endcode %}

## Repositories

The first steps are:

* The creation of your [Credential Source repository](https://webauthn-doc.spomky-labs.com/v4.9/symfony-bundle/entities-with-doctrine)
* The creation of your [User Entity repository](https://webauthn-doc.spomky-labs.com/v4.9/symfony-bundle/entities-with-doctrine-1).

You may also want to configure the other options offered by the bundle. Please refer to the [configuration references](https://webauthn-doc.spomky-labs.com/v4.9/symfony-bundle/configuration-references).

## Firewall

Now you have a fully configured bundle, you can protect your routes and manage the user registration and authenticatin through the [Symfony Firewall](https://webauthn-doc.spomky-labs.com/v4.9/symfony-bundle/firewall).


---

# 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://webauthn-doc.spomky-labs.com/v4.9/symfony-bundle/the-symfony-way.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.
