# backstage-plugin-opslevel-backend

> [![Overall](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fapp.opslevel.com%2Fapi%2Fservice_level%2FL6pkRwdgleo4ZoLC4IaR0LaNwaesYvv7LP70yg-qpwI)](https://app.opslevel.com/services/backstage-plugin-backend/maturity-report) [![npm](https://img

Latest version **1.0.6** (published 2023-10-25) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install backstage-plugin-opslevel-backend
pnpm add backstage-plugin-opslevel-backend
yarn add backstage-plugin-opslevel-backend
bun add backstage-plugin-opslevel-backend
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2023-10-25 |
| First published | 2023-06-01 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 18 |
| Unpacked size | 48.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | patrick_at_opslevel, kyle-opslevel, kenrose, katerberg-opslevel, sergio-opslevel |
| Keywords | backstage, service maturity, service quality, maturity score |

## Links

- npm: https://www.npmjs.com/package/backstage-plugin-opslevel-backend
- Repository: https://github.com/OpsLevel/backstage-plugin-backend
- Homepage: https://github.com/OpsLevel/backstage-plugin-backend#readme
- Issues: https://github.com/OpsLevel/backstage-plugin-backend/issues
- npm.io page: https://npm.io/package/backstage-plugin-opslevel-backend

## Dependencies (18)

- [yn](https://npm.io/package/yn.md) ^5.0.0
- [cron](https://npm.io/package/cron.md) ^2.3.1
- [knex](https://npm.io/package/knex.md) ^2.4.2
- [express](https://npm.io/package/express.md) ^4.17.3
- [limiter](https://npm.io/package/limiter.md) ^2.1.0
- [winston](https://npm.io/package/winston.md) ^3.9.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^3.3.1
- [@types/cron](https://npm.io/package/@types/cron.md) ^2.0.1
- [@types/express](https://npm.io/package/@types/express.md) *
- [graphql-request](https://npm.io/package/graphql-request.md) ^6.1.0
- [@backstage/config](https://npm.io/package/@backstage/config.md) ^1.0.3
- [express-promise-router](https://npm.io/package/express-promise-router.md) ^4.1.0
- [@backstage/backend-tasks](https://npm.io/package/@backstage/backend-tasks.md) ^0.5.10
- [@backstage/catalog-model](https://npm.io/package/@backstage/catalog-model.md) ^1.3.0
- [@backstage/backend-common](https://npm.io/package/@backstage/backend-common.md) ^0.18.5
- [@backstage/catalog-client](https://npm.io/package/@backstage/catalog-client.md) ^1.4.1
- [@backstage/plugin-auth-node](https://npm.io/package/@backstage/plugin-auth-node.md) ^0.2.14
- [@backstage/backend-plugin-api](https://npm.io/package/@backstage/backend-plugin-api.md) ^0.6.5

## Recent versions

- 1.0.6 (latest) — 2023-10-25
- 1.0.5 — 2023-10-20
- 1.0.4 — 2023-10-12
- 1.0.3 — 2023-06-08
- 1.0.2 — 2023-06-06
- 1.0.1 — 2023-06-02
- 1.0.0 — 2023-06-01

## README

[![Overall](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fapp.opslevel.com%2Fapi%2Fservice_level%2FL6pkRwdgleo4ZoLC4IaR0LaNwaesYvv7LP70yg-qpwI)](https://app.opslevel.com/services/backstage-plugin-backend/maturity-report)
[![npm](https://img.shields.io/npm/v/@opslevel/backstage-maturity-backend)](https://www.npmjs.com/package/@opslevel/backstage-maturity-backend)

# OpsLevel Maturity Backend Plugin

## Deprecated: please use `@opslevel/backstage-maturity-backend`

This package has been moved into the `opslevel` namespace and is accessible from via `@opslevel/backstage-maturity-backend`.

This plugin, in combination with the [frontend plugin](https://github.com/OpsLevel/backstage-plugin), provides automatic, scheduled
export functionality of users, groups, and components from Backstage into OpsLevel.

## Installation

### Step 1

In the root directory of your Backstage installation, run the following command:

```bash
yarn add --cwd packages/backend @opslevel/backstage-maturity-backend
```

### Step 2

Create a file called `opslevel.ts` in the `packages/backend/src/plugins` subdirectory of your Backstage installation and insert the following contents:

```ts
import { Router } from 'express';
import { PluginEnvironment } from '../types';
import { OpsLevelBuilder } from '@opslevel/backstage-maturity-backend';

export default async function createPlugin(
  env: PluginEnvironment,
): Promise<Router> {
  const builder = await OpsLevelBuilder.create(env);
  const router = await builder.build();

  return router;
}
```

### Step 3

Open the `index.ts` file in the `packages/backend/src` subdirectory of your Backstage installation with the code editor of your choice.

#### Step 3.1

Add the following line after the end of the existing import statements:

```ts
import opslevel from './plugins/opslevel';
```

#### Step 3.2

Add the following statement to the cluster of similar statements near the top of the `main()` function:

```ts
const opslevelEnv = useHotMemoize(module, () => createEnv('opslevel'));
```

#### Step 3.3

Add the following statement to the cluster of similar statements a bit further down in the `main()` function:

```ts
apiRouter.use('/opslevel', await opslevel(opslevelEnv));
```

### Step 4

If you haven't done so already when installing the [frontend plugin](https://github.com/OpsLevel/backstage-plugin), update your `app-config.yaml` file to add a proxy for OpsLevel. Replace `<your_OpsLevel_API_token>` with a token from https://app.opslevel.com/api_tokens.

```yaml
proxy:
  '/opslevel':
    target: 'https://app.opslevel.com'
    headers:
      X-Custom-Source: backstage
      Authorization: Bearer <your_OpsLevel_API_token>
    allowedHeaders: ['GraphQL-Visibility']
```

---
_Source: https://npm.io/package/backstage-plugin-opslevel-backend · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
