0.0.9 • Published 4 years ago

@smiledev/react-web-feedback v0.0.9

Weekly downloads
12
License
ISC
Repository
github
Last release
4 years ago

Using React

Installation

  • Install from NPM
npm install @smiledev/react-web-feedback@latest

Usage

  • Import FeedbackButton and handlers (optional) in your project. Prop token is provided by Smile.
import FeedbackButton from "@smiledev/react-web-feedback/dist/FeedbackButton"

<FeedbackButton token={'******'} />

Handlers

You can interact with Smile Feedback with the following handlers

showModal

Shows the Feedback modal.

import { showModal } from "@smiledev/react-web-feedback/dist/FeedbackButton";

showModal(); // Open modal

hideModal

Hides the Feedback modal.

import { hideModal } from "@smiledev/react-web-feedback/dist/FeedbackButton";

hideModal(); // Hide modal

getUserContext

Returns the user context currently known by Feedback Button.

import { getUserContext } from "@smiledev/react-web-feedback/dist/FeedbackButton";

getUserContext(); // { ... }

setUserContext

Updates the user context to Feedback Button.

import { setUserContext } from "@smiledev/react-web-feedback/dist/FeedbackButton";

setUserContext({
  id: 1,
  first_name: 'Bruce',
  last_name: 'Wayne'
});
0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.5

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago