# Feedback Widget

![Frame 525](https://user-images.githubusercontent.com/23535123/181665543-95ee7c9c-c7cc-4a2c-ab5b-7f74e8c54cec.png)

## Usage

Import the widget

```html
<script
  type="module"
  src="https://cdn.logsnag.com/feedback/ls.js"
></script>
```

## Add data tags to your button

```html
<button
  data-logsnag-feedback
  data-logsnag-token="<API_TOKEN>"
  data-logsnag-project="<PROJECT>"
  data-logsnag-channel="<CHANNEL>"
>
  Feedback
</button>
```

## Include User ID

You may include the user id by adding the `data-logsnag-user-id` tag to your button.

```html
<button
  data-logsnag-feedback
  data-logsnag-token="<API_TOKEN>"
  data-logsnag-project="<PROJECT>"
  data-logsnag-channel="<CHANNEL>"
  data-logsnag-user-id="<USER_ID>"
>
  Feedback
</button>
```

## Add custom tags

You may add custom tags to your feedback widget by adding the following data tags to your button.

```html
<button
  data-logsnag-feedback
  <!-- custom username tag -->
  data-logsnag-tag-username="john.doe"
  data-logsnag-token="<API_TOKEN>"
  data-logsnag-project="<PROJECT>"
  data-logsnag-channel="<CHANNEL>"
>
  Feedback
</button>
```

{% hint style="danger" %}
**Important**: Please ensure that your token is set to "Public" and that its roles are limited to the project that you're logging to.
{% endhint %}

![Screen Shot 2022-07-28 at 1 34 17 PM](https://user-images.githubusercontent.com/23535123/181601494-93396b89-67da-4538-b535-557b68af12d3.png)
