Component resolvers extend the component framework through an


[](https://fuchsia.dev/docs/glossary#environment)


to resolve a


[](https://fuchsia.dev/docs/glossary#component-url)


into a component.

Component manager resolves component URLs by finding a resolver that supports a
matching URL scheme in the relevant environment and sending a request using the
[`fuchsia.component.resolution.Resolver`](https://cs.opensource.google/fuchsia/fuchsia/+/main:/sdk/fidl/fuchsia.component.resolution/resolver.fidl) protocol.

If resolution succeeds, the component resolver returns a
[`ComponentDecl`](https://cs.opensource.google/fuchsia/fuchsia/+/main:/sdk/fidl/fuchsia.component.decl/component.fidl), the FIDL representation of a
[component manifest](https://fuchsia.dev/docs/concepts/components/v2/component_manifests). If the component being resolved has
an associated package, the component resolver also returns a
[`fuchsia.io.Directory`](https://cs.opensource.google/fuchsia/fuchsia/+/main:/sdk/fidl/fuchsia.io/directory.fidl) handle for the package directory.

## Providing resolver capabilities

To provide a resolver capability, a component must declare a `resolver`
capability, whose `path` designates a FIDL protocol implementing
[`fuchsia.component.resolution.Resolver`](https://cs.opensource.google/fuchsia/fuchsia/+/main:/sdk/fidl/fuchsia.component.resolution/resolver.fidl) served from the component's


[](https://fuchsia.dev/docs/glossary#outgoing-directory)


.

    {
        capabilities: [
            {
                resolver: "my_resolver",
                path: "/svc/fuchsia.component.resolution.Resolver",
            },
        ],
    }

Component manager submits requests to resolve a component URL to this protocol.

## Routing resolver capabilities

Components route resolver capabilities by [exposing](https://fuchsia.dev/fuchsia-src/concepts/components/v2/capabilities/resolver#expose) them to their
parent and [offering](https://fuchsia.dev/fuchsia-src/concepts/components/v2/capabilities/resolver#offer) them to their children.

For more details on how the framework routes component capabilities,
see [capability routing](https://fuchsia.dev/docs/concepts/components/v2/capabilities/README#routing).

### Exposing

Exposing a resolver capability gives the component's parent access to that
capability:

    {
        expose: [
            {
                resolver: "my_resolver",
                from: "self",
            },
        ],
    }

### Offering

Offering a resolver capability gives a child component access to that
capability:

    {
        offer: [
            {
                resolver: "my_resolver",
                from: "self",
                to: [ "#child-a" ],
            },
        ],
    }

## Registering a component resolver

Component resolvers are made available to components through their
[environment](https://fuchsia.dev/docs/concepts/components/v2/environments). To register a new resolver within an environment,
add a new entry to the `resolvers` section of the `environments` declaration:

    environments: [
        {
            name: "my-environ",
            extends: "realm",
            resolvers: [
                {
                    resolver: "my_resolver",
                    scheme: "my-scheme",
                    from: "parent",
                }
            ],
        },
    ]

The registered resolver will be used to resolve component URLs whose URL scheme
matches the provided `scheme`.

For more details on how to apply environments to components, see the
[environments documentation](https://fuchsia.dev/docs/concepts/components/v2/environments).

## Framework resolvers

Component framework provides the following built-in component resolvers to
support standard Fuchsia URL schemes:

| Resolver | URL scheme |
|---|---|
| `boot_resolver` | [`fuchsia-boot`](https://fuchsia.dev/docs/reference/components/url#fuchsia-boot) |
| `base_resolver` | [`fuchsia-pkg`](https://fuchsia.dev/docs/reference/components/url#fuchsia-pkg) |
| `full_resolver` | [`fuchsia-pkg`](https://fuchsia.dev/docs/reference/components/url#fuchsia-pkg) |

[](https://issues.fuchsia.dev/issues/new?component=1439230&template=1881640&description=Issue+on:+https://fuchsia.dev/docs/concepts/components/v2/capabilities/resolver.md "Report a bug or suggest improvements on this page") [](https://cs.opensource.google/fuchsia/fuchsia/+/main:docs/concepts/components/v2/capabilities/resolver.md "View the source code of this page") [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/concepts/components/v2/capabilities/resolver.md&cloneRepo=fuchsia/fuchsia:refs/heads/main&fullPath=fuchsia/docs/concepts/components/v2/capabilities/resolver.md "Edit the source code of this page")