# guest-feedback-module

> This sends gets allows the guest to directly send us feedback

Latest version **0.2.0** (published 2022-02-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install guest-feedback-module
pnpm add guest-feedback-module
yarn add guest-feedback-module
bun add guest-feedback-module
```

## Health

**Score 25/100 (F)** — status: abandoned.

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2022-02-23 |
| First published | 2022-02-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 147.2 KB |
| Known vulnerabilities | 0 (+24 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | rofer |

## Links

- npm: https://www.npmjs.com/package/guest-feedback-module
- npm.io page: https://npm.io/package/guest-feedback-module

## Dependencies (7)

- [axios](https://npm.io/package/axios.md) ^0.26.0
- [ts-loader](https://npm.io/package/ts-loader.md) ^9.2.6
- [squirrelly](https://npm.io/package/squirrelly.md) ^8.0.8
- [sweetalert2](https://npm.io/package/sweetalert2.md) ^11.4.0
- [webpack-cli](https://npm.io/package/webpack-cli.md) ^4.9.2
- [@types/squirrelly](https://npm.io/package/@types/squirrelly.md) ^7.1.2
- [guest-feedback-module](https://npm.io/package/guest-feedback-module.md) ^0.1.20

## Recent versions

- 0.2.0 (latest) — 2022-02-23
- 0.1.24 — 2022-02-18
- 0.1.22 — 2022-02-18
- 0.1.21 — 2022-02-18
- 0.1.20 — 2022-02-18
- 0.1.19 — 2022-02-18
- 0.1.18 — 2022-02-18
- 0.1.16 — 2022-02-18
- 0.1.15 — 2022-02-18
- 0.1.14 — 2022-02-18
- 0.1.13 — 2022-02-18
- 0.1.12 — 2022-02-18
- 0.1.11 — 2022-02-18
- 0.1.10 — 2022-02-18
- 0.1.9 — 2022-02-18
- … 9 more at https://npm.io/package/guest-feedback-module/versions

## README

# 🚀 Welcome to the Guest Feedback Module

## Description

This project is a one stop shop for gathering guest feedback via email. By making the usage as simple as possible as well as making it platform agnostic it makes it possible to add to virtually any project.

## Intallation

Intalling the library in a project is as simple as:

```
npm install guest-feedback-module

```

## Usage

Import the class from the library
Instantiate it with your api key
Then bind the 'gatherFeedback' to any event you would like.

Here is an example binding the method to a button click handler:

```javascript
import GuestFeedback from "guest-feedback-module";
const gfm = new GuestFeedback("yourApiKeyGoesHere");
const appConfig = {
  appSpecificText:
    "body of the email you want sent goes here, useful if you want to talk about dateleg, app, how this was collected etc...",
  Subject: "subject line of the email",
};
```

The project ships with typescript definitions, weather you use them or not you should be able to get hints on the valid users

```html
<button onClick="gfm.gatherFeedback(['rafa', 'another valid user'], appConfig)">
  clickMe
</button>
```

** Note: ** The emails is an array and supports you adding as many emails to the distribution list as you would like.

## Internal API

### send-request-to-api

inputs ( key: string ), ( email: {To, From, HtmlBody, Subject} )
it appends the api key to the query parameters as &#x27;key&#x27;
performs the axios request
returns (statusCodes: 200, 400, 500)

### generate-email-from-input

Generate the template
Return the email object

### handle-email-request REMOTE

get key from query parameter of name key
sha256 it and compare it to the known sample -- diff entrypoint
if 1 send prod email then send 200
if 0 send 400
if -1 send 200 and send test email

### validate-key REMOTE

input -- key: string
apply sha256 to the key
compare it to the known keys dictionary
return ValidationResult\_

### get-secret REMOTE

import google secrets manager
pull the secret path from the config
start a new secrets manager instance
use the instance to return the secret value

## Screenshots

#### User Interface

![Usr-interface](https://i.ibb.co/Pjt8xhj/Screenie1.png, "User Interface")

#### Email Notification

![Email-notificaiton](https://i.ibb.co/mFVRqwm/Screenie2.png, "Email Notification")

#### Made With

![coco-oil](https://i.ibb.co/Q9fBXb6/Screen-Shot-2021-12-21-at-12-47-02-PM.png, "Made With Coco Oil")

### unpack-emails REMOTE

get the users array from the To field of the email
map the users array to an actual email
return a new email with actual emails in the to field

---
_Source: https://npm.io/package/guest-feedback-module · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
