# @janus-idp/backstage-plugin-feedback-backend

> This is feedback-backend plugin which provides Rest API to create feedbacks.

Latest version **1.3.11** (published 2024-10-11) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @janus-idp/backstage-plugin-feedback-backend
pnpm add @janus-idp/backstage-plugin-feedback-backend
yarn add @janus-idp/backstage-plugin-feedback-backend
bun add @janus-idp/backstage-plugin-feedback-backend
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.3.11 |
| Published | 2024-10-11 |
| First published | 2024-01-18 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 16 |
| Unpacked size | 118.9 KB |
| Known vulnerabilities | 0 (+8 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 163 |
| Author | The Backstage Community |
| Maintainers | schultzp2020, ktsao, asoro-rh, pataknight, nickboldt, tomaskral, tumido |
| Keywords | support:tech-preview, lifecycle:active, backstage, plugin |

## Links

- npm: https://www.npmjs.com/package/@janus-idp/backstage-plugin-feedback-backend
- Repository: https://github.com/janus-idp/backstage-plugins
- Homepage: https://red.ht/rhdh
- Issues: https://github.com/janus-idp/backstage-plugins/issues
- npm.io page: https://npm.io/package/@janus-idp/backstage-plugin-feedback-backend

## Dependencies (16)

- [yn](https://npm.io/package/yn.md) ^4.0.0
- [knex](https://npm.io/package/knex.md) ^3.1.0
- [axios](https://npm.io/package/axios.md) ^1.6.4
- [express](https://npm.io/package/express.md) ^4.17.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.7
- [nodemailer](https://npm.io/package/nodemailer.md) ^6.9.8
- [short-uuid](https://npm.io/package/short-uuid.md) ^4.2.2
- [@types/express](https://npm.io/package/@types/express.md) *
- [@backstage/config](https://npm.io/package/@backstage/config.md) ^1.2.0
- [express-promise-router](https://npm.io/package/express-promise-router.md) ^4.1.0
- [@backstage/catalog-model](https://npm.io/package/@backstage/catalog-model.md) ^1.4.5
- [@backstage/backend-common](https://npm.io/package/@backstage/backend-common.md) ^0.21.7
- [@backstage/catalog-client](https://npm.io/package/@backstage/catalog-client.md) ^1.6.4
- [@backstage/backend-plugin-api](https://npm.io/package/@backstage/backend-plugin-api.md) ^0.6.17
- [@backstage/backend-test-utils](https://npm.io/package/@backstage/backend-test-utils.md) ^0.3.7
- [@backstage/backend-dynamic-feature-service](https://npm.io/package/@backstage/backend-dynamic-feature-service.md) ^0.2.10

## Recent versions

- 1.3.11 (latest) — 2024-10-11
- 1.7.2 — 2024-08-19
- 1.7.1 — 2024-08-16
- 1.7.0 — 2024-07-26
- 1.6.0 — 2024-07-24
- 1.5.1 — 2024-06-19
- 1.5.0 — 2024-06-13
- 1.4.0 — 2024-06-13
- 1.3.10 — 2024-06-13
- 1.3.9 — 2024-06-12
- 1.3.8 — 2024-06-05
- 1.3.7 — 2024-06-04
- 1.3.6 — 2024-06-04
- 1.3.5 — 2024-06-03
- 1.3.4 — 2024-05-29
- … 19 more at https://npm.io/package/@janus-idp/backstage-plugin-feedback-backend/versions

## README

# Feedback Backend

This is feedback-backend plugin which provides Rest API to create feedbacks.

It is also responsible for creating JIRA tickets,

## Getting started

### Installation

Install the NPM Package

```bash
# From your backstage root directory
yarn workspace backend add @janus-idp/backstage-plugin-feedback-backend
```

#### Adding the plugin to the new backend

Add the following to your `packages/backend/src/index.ts` file:

```ts title="packages/backend/src/index.ts"
const backend = createBackend();

// Add the following line
backend.add(import('@janus-idp/backstage-plugin-feedback-backend'));

backend.start();
```

#### Adding the plugin to the legacy backend (`@janus-idp/backstage-plugin-feedback-backend@1.2.6` and lower)

1. Create a new file `packages/backend/src/plugins/feedback.ts` and add the following:

   ```ts title="packages/backend/src/plugins/feedback.ts"
   import { Router } from 'express';

   import { createRouter } from '@janus-idp/backstage-plugin-feedback-backend';

   import { PluginEnvironment } from '../types';

   export default async function createPlugin(
     env: PluginEnvironment,
   ): Promise<Router> {
     return await createRouter({
       logger: env.logger,
       config: env.config,
       discovery: env.discovery,
     });
   }
   ```

2. Next we wire this into overall backend router by editing the `packages/backend/src/index.ts` file:

   ```ts title="packages/backend/src/index.ts"
   import feedback from './plugins/feedback';

   // ...
   async function main() {
     // ...
     const feedbackEnv = useHotMemoize(module, () => createEnv('feedback'));
     apiRouter.use('/feedback', await feedback(feedbackEnv));
   }
   ```

### Configurations

Add the following config in your `app-config.yaml` file.

```yaml
feedback:
  integrations:
    jira:
      # Under this object you can define multiple jira hosts
      - host: ${JIRA_HOST_URL}
        # Add your jira token along with Basic or Bearer type eg: Basic/Bearer <token>
        token: ${JIRA_TOKEN}
        # (optional) Due to GDPR limitations on jira cloud instances
        # set hostType: CLOUD to make api work
        # default value is SERVER
        hostType: CLOUD

    email:
      ## Email integration uses nodemailer to send emails
      host: ${EMAIL_HOST}
      port: ${EMAIL_PORT} # defaults to 587, if not found

      ## Email address of sender
      from: ${EMAIL_FROM}

      ## [optional] Authorization using user and password
      auth:
        user: ${EMAIL_USER}
        pass: ${EMAIL_PASS}

      # boolean
      secure: false

      # Path to ca certificate if required by mail server
      caCert: ${NODE_EXTRA_CA_CERTS}
```

### Set up frontend plugin

Follow instructions provided [feedback-plugin](../feedback/README.md)

### API reference

The API specifications file can be found at [docs/openapi3_0](./docs/openapi3_0.yaml)

### Running the plugin

Run `yarn workspace @janus-idp/backstage-plugin-feedback-backend start`.

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