---
lang: en
title: 'API docs: context.binding.to'
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.binding.to.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [Binding](./context.binding.md) &gt; [to](./context.binding.to.md)

## Binding.to() method

Bind the key to a constant value. The value must be already available at binding time, it is not allowed to pass a Promise instance.

**Signature:**

```typescript
to(value: T): this;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

value


</td><td>

T


</td><td>

The bound value.


</td></tr>
</tbody></table>
**Returns:**

this

## Example


```ts
ctx.bind('appName').to('CodeHub');
```


