> For the complete documentation index, see [llms.txt](https://vostok.gitbook.io/configuration/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vostok.gitbook.io/configuration/advanced-scenarios/use-shared-provider-instance.md).

# Use shared provider instance

**Requires**: [main module](/configuration/modules/configuration.md).

[Configuration provider](/configuration/concepts-and-basics/configuration-provider.md) class has a property named `Default` that serves as a global static source of `IConfigurationProvider` instance.

It's intended use case is self-sufficient configuration in libraries: library authors may not want to force their users to provide an `IConfigurationProvider` instance each time they're using library classes. Instead, these classes could just obtain a log from the shared property:

```
ConfigurationProvider.Default.SetupSourceFor<MyLibrarySettings>(...);

var settings = ConfigurationProvider.Default.Get<MyLibrarySettings>();
```

By default this property returns a singleton provider with default settings. It can be configured explicitly in the application:

```
var providerSettings = new ConfigurationProviderSettings { ... };
var provider = new ConfigurationProvider(providerSettings);

// Will return false if already explicitly configured:
ConfigurationProvider.TrySetDefault(provider);
```

### Related pages

{% content-ref url="/pages/-M6UQugcsHv63ilSF945" %}
[Configuration provider](/configuration/concepts-and-basics/configuration-provider.md)
{% endcontent-ref %}
