> 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/sources/constant-source.md).

# Constant sources

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

### [ConstantSource](https://github.com/vostok/configuration.sources/blob/master/Vostok.Configuration.Sources/Constant/ConstantSource.cs)

A constant source returns a preconfigured [settings node](/configuration/concepts-and-basics/settings-nodes.md) and never issues any updates.

```
var source = new ConstantSource(new ValueNode("value"));
```

### [LazyConstantSource](https://github.com/vostok/configuration.sources/blob/master/Vostok.Configuration.Sources/Constant/LazyConstantSource.cs)

A lazy constant source does the same but defers the node acquisition until first subscription:

```
var source = new LazyConstantSource(() => new ValueNode("value"));
```

Errors in the provided delegate are propagated via `(null, error)` notification. It's guaranteed to execute not more than once.

### Practical use

Constant sources are handy for unit testing and may serve as base classes for [custom sources](/configuration/advanced-scenarios/create-custom-sources.md).

### Related pages

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