@indextrus/waitlyst-js v1.0.40
Waitlyst.js ES Module
Note: A waitlyst account is required to collect in-app feedback. You can register at https://waitlyst.co
Tip: To only accept feedback from a trusted list of domains, you can update your trusted list of domains here
Installation
If you plan to consume this package as an ES6 module:
npm install @indextrus/waitlyst-js
Alternatively, if you plan to use this in your browser include this script in your head
element:
<script src="https://cdn.waitlyst.co/sdk/waitlyst.js"></script>
Usage
Collecting in-app feedback with Waitlyst is very easy and can be done in two steps. 1. Initialize your module
const waitlyst = new Waitlyst("yourPublishableKey")
TIP: The code above must be initialized after your DOM has loaded:
// Here are some examples below
// Angular -> AfterViewInit
// React -> ComponentDidMount
// Jquery -> document.ready(function() { ... })
// VanillaJS -> document.addEventListener('DOMContentLoaded', callbackFunction, false);
- Attach
data-waitlyst-element="feedback"
and this package will automatically find and attach a waitlyst feedback widget to them
<button type="button" data-waitlyst-element="feedback">Click me</button>
Identifying users
Waitlyst feedback widgets usually ask users for their emails if they want to receive updates on the status of their feedback.
If this a user within your product, you can identify them before they submit a feedback item:
const waitlyst = new Waitlyst("yourPublishableKey");
waitlyst.identify({
firstName: "John",
lastName: "Doe",
email: "johndoe@example.com" // Required
})
Advanced usage
You can attach ids to an element and manually trigger them. This is especially useful for displaying widgets in context when a user take a certain action or encounters an error in your app.
<button type="button" data-waitlyst-element="feedback" id="feedback-button">Click me</button>
and then you can envoke it by:
const waitlyst = new Waitlyst("yourPublishableKey")
// To open
waitlyst.elements.open("feedback-button");
// To close
waitlyst.elements.close("feedback-button")
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago