---
lang: en
title: 'API docs: context.configurationresolver.getconfigasvalueorpromise'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/context
permalink: /doc/en/lb4/apidocs.context.configurationresolver.getconfigasvalueorpromise.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [ConfigurationResolver](./context.configurationresolver.md) &gt; [getConfigAsValueOrPromise](./context.configurationresolver.getconfigasvalueorpromise.md)

## ConfigurationResolver.getConfigAsValueOrPromise() method

Resolve config for the binding key

**Signature:**

```typescript
getConfigAsValueOrPromise<ConfigValueType>(key: BindingAddress<unknown>, propertyPath?: string, resolutionOptions?: ResolutionOptions): ValueOrPromise<ConfigValueType | undefined>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td markdown="1">

key


</td><td markdown="1">

[BindingAddress](./context.bindingaddress.md)<!-- -->&lt;unknown&gt;


</td><td markdown="1">

Binding key


</td></tr>
<tr><td markdown="1">

propertyPath


</td><td markdown="1">

string


</td><td markdown="1">

_(Optional)_ Property path for the option. For example, `x.y` requests for `<config>.x.y`<!-- -->. If not set, the `config` object will be returned.


</td></tr>
<tr><td markdown="1">

resolutionOptions


</td><td markdown="1">

[ResolutionOptions](./context.resolutionoptions.md)


</td><td markdown="1">

_(Optional)_ Options for the resolution. - optional: if not set or set to `true`<!-- -->, `undefined` will be returned if no corresponding value is found. Otherwise, an error will be thrown.


</td></tr>
</tbody></table>

**Returns:**

[ValueOrPromise](./context.valueorpromise.md)<!-- -->&lt;ConfigValueType \| undefined&gt;


