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

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

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [BindingScope](./context.bindingscope.md)

## BindingScope enum

Scope for binding values

**Signature:**

```typescript
export declare enum BindingScope 
```

## Enumeration Members

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

Member


</th><th>

Value


</th><th>

Description


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

APPLICATION


</td><td>

`"Application"`


</td><td>

Application scope


</td></tr>
<tr><td>

CONTEXT


</td><td>

`"Context"`


</td><td>


</td></tr>
<tr><td>

REQUEST


</td><td>

`"Request"`


</td><td>

Request scope


</td></tr>
<tr><td>

SERVER


</td><td>

`"Server"`


</td><td>

Server scope


</td></tr>
<tr><td>

SINGLETON


</td><td>

`"Singleton"`


</td><td>

The binding provides a value as a singleton within the context hierarchy (the owning context and its descendants). The value is calculated only once for the owning context and cached for subsequential uses. Child contexts share the same value as their ancestors.

For example, with the following context hierarchy:

- `app` (with a binding `'b1'` that produces sequential values 0, 1, ...) - req1 - req2

1. `0` is the singleton for `app` afterward - app.get('b1') ==<!-- -->&gt; 0 (always)

2. `'b1'` is resolved in `app`<!-- -->, reuse it for `req1` - req1.get('b1') ==<!-- -->&gt; 0 (always)

3. `'b1'` is resolved in `app`<!-- -->, reuse it for `req2` - req2.get('b1') ==<!-- -->&gt; 0 (always)


</td></tr>
<tr><td>

TRANSIENT


</td><td>

`"Transient"`


</td><td>

The binding provides a value that is calculated each time. This will be the default scope if not set.

For example, with the following context hierarchy:

- `app` (with a binding `'b1'` that produces sequential values 0, 1, ...) - req1 - req2

Now `'b1'` is resolved to a new value each time for `app` and its descendants `req1` and `req2`<!-- -->: - app.get('b1') ==<!-- -->&gt; 0 - req1.get('b1') ==<!-- -->&gt; 1 - req2.get('b1') ==<!-- -->&gt; 2 - req2.get('b1') ==<!-- -->&gt; 3 - app.get('b1') ==<!-- -->&gt; 4


</td></tr>
</tbody></table>


