@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
97 lines (48 loc) • 1.67 kB
Markdown
---
lang: en
title: 'API docs: context.context.getconfig'
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.context.getconfig.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [Context](./context.context.md) > [getConfig](./context.context.getconfig.md)
## Context.getConfig() method
Resolve configuration for the binding by key
**Signature:**
```typescript
getConfig<ConfigValueType>(key: BindingAddress, propertyPath?: string, resolutionOptions?: ResolutionOptions): Promise<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)
</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.
</td></tr>
</tbody></table>
**Returns:**
Promise<ConfigValueType \| undefined>