> 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/basic-scenarios/obtain-settings-from-provider.md).

# Obtain settings from provider

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

Settings can be obtained on-demand with [configuration provider](/configuration/concepts-and-basics/configuration-provider.md)'s **Get** method.

With prior [assignment of sources](/configuration/basic-scenarios/assign-sources-to-types.md):

```
var settings = provider.Get<MySettings>();
```

With sources passed on per-call basis:

```
var settings = provider.Get<MySettings>(new JsonFileSource("settings.json"));
```

### Get method behavior

* Always returns the most recent version of settings (updates may happen in background):

  * Call **Get** on every settings access for "hot" configuration;
  * Call **Get** once and cache the result for "cold" configuration;

* First call for a type may block or [throw exceptions](/configuration/concepts-and-basics/error-handling.md) due to source latency, data unavailability or incorrect data format. This behavior persists until a data update remedies the error;

* Once warmed up, subsequent calls never block or throw errors and are extremely cheap due to [caching](/configuration/concepts-and-basics/caching-and-performance.md). Future errors are not propagated to the calling code, but [can be logged](/configuration/basic-scenarios/log-errors.md). **Get** calls return the last seen correct settings object;

### Related pages

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

{% content-ref url="/pages/-M6UQMklC2EtQ\_nAUDjI" %}
[Configuration sources](/configuration/concepts-and-basics/configuration-sources.md)
{% endcontent-ref %}

{% content-ref url="/pages/-M6URAB0ITAnAJKMQJ6y" %}
[Caching and performance](/configuration/concepts-and-basics/caching-and-performance.md)
{% endcontent-ref %}

{% content-ref url="/pages/-M6UR6uAo\_v35e9-OcDC" %}
[Error handling](/configuration/concepts-and-basics/error-handling.md)
{% endcontent-ref %}
