# @sap-devx/feature-toggle-node

> A Node.js module for enabling or disabling Node.js-based SAP Business Application Studio features.

Latest version **2.1.1** (published 2026-10-05) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @sap-devx/feature-toggle-node
pnpm add @sap-devx/feature-toggle-node
yarn add @sap-devx/feature-toggle-node
bun add @sap-devx/feature-toggle-node
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2026-10-05 |
| First published | 2020-04-19 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 49.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 22 |
| Author | SAP SE |
| Maintainers | shahars, rima.sirich, sap-ospo-admin |

## Links

- npm: https://www.npmjs.com/package/@sap-devx/feature-toggle-node
- Repository: https://github.com/SAP/app-studio-toolkit
- Issues: https://github.com/SAP/app-studio-toolkit/issues
- npm.io page: https://npm.io/package/@sap-devx/feature-toggle-node

## Dependencies (1)

- [node-cache](https://npm.io/package/node-cache.md) 5.1.2

## Recent versions

- 2.1.1 (latest) — 2026-10-05
- 2.1.0 — 2026-03-04
- 2.0.3 — 2025-03-10
- 2.0.2 — 2023-01-09
- 2.0.1 — 2022-01-23
- 2.0.0 — 2022-01-19
- 1.0.12 — 2021-11-08
- 1.0.11 — 2021-11-07
- 1.0.10 — 2021-09-02
- 1.0.9 — 2021-07-28
- 1.0.8 — 2021-01-20
- 1.0.7 — 2021-01-04
- 1.0.6 — 2020-11-02
- 1.0.5 — 2020-07-23
- 1.0.4 — 2020-07-01
- … 9 more at https://npm.io/package/@sap-devx/feature-toggle-node/versions

## README

[![REUSE status](https://api.reuse.software/badge/github.com/SAP/app-studio-toolkit)](https://api.reuse.software/info/github.com/SAP/app-studio-toolkit)

# @sap-devx/feature-toggle-node

A Node.js module for enabling or disabling Node.js-based SAP Business Application Studio features.

## Description

This module is used to inquire whether an SAP Business Application Studio feature toggle is enabled or disabled.

Use it if your SAP Business Application Studio extension is written in Node.js or TypeScript and you want to control the extension's features via a feature toggle.

## Requirements

- ES2017 or higher

## Download and Installation

Install `@sap-devx/feature-toggle-node` as a dependency:

```
npm install @sap-devx/feature-toggle-node --save
```

### Configuration

To run `feature-toggle-node` **locally**, provide the following environment variables:

#### Mandatory:

- `WORKSPACE_ID` - ID of the workspace
- `LANDSCAPE_ENVIRONMENT`
- `LANDSCAPE_NAME`

#### Optional:

- `USER_NAME` - Name of the user logged into SAP Business Application Studio
- `TENANT_ID`
- `TENANT_NAME`
- `FTM_HOST` - Feature toggle server host
- `LANDSCAPE_INFRASTRUCTURE`
- `SHOW_LOG` - If `true`, displays console logs

Environment variables example:

```
"FTM_HOST": "http://localhost:8080",
"USER_NAME": "user@hotmail.com",
"TENANT_ID" : "b5c05535-9495-4050-9d68-4356d0d34136",
"TENANT_NAME": "cfsubaccount",
"WORKSPACE_ID": "workspaces-ws-x66m6",
"SHOW_LOG": "true"
```

## Usage

Use `feature-toggle-node` as follows:

```typescript
import { isFeatureEnabled } from "@sap-devx/feature-toggle-node";

(async () => {
  if (await isFeatureEnabled("EXTENSION_NAME", "FEATURE_TOGGLE_NAME")) {
    console.log(`Feature is Enabled`);
  } else {
    console.log(`Feature is Disabled`);
  }
})();
```

## Support

To get more help, support, and information please open a GitHub
[issue](https://github.com/SAP/app-studio-toolkit/issues/new/choose) and label it with `project:feature-toggle-node`.

## Contributing

Contributions are welcome. See the monorepo [CONTRIBUTING](https://github.com/SAP/app-studio-toolkit/blob/main/CONTRIBUTING.md) guide.

---
_Source: https://npm.io/package/@sap-devx/feature-toggle-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
