---
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

|  Parameter | Type | Description |
|  --- | --- | --- |
|  key | [BindingAddress](./context.bindingaddress.md)<!-- -->&lt;unknown&gt; | Binding key |
|  propertyPath | string | _(Optional)_ Property path for the option. For example, <code>x.y</code> requests for <code>&lt;config&gt;.x.y</code>. If not set, the <code>config</code> object will be returned. |
|  resolutionOptions | [ResolutionOptions](./context.resolutionoptions.md) | _(Optional)_ Options for the resolution. - optional: if not set or set to <code>true</code>, <code>undefined</code> will be returned if no corresponding value is found. Otherwise, an error will be thrown. |

**Returns:**

[ValueOrPromise](./context.valueorpromise.md)<!-- -->&lt;ConfigValueType \| undefined&gt;


