1.0.40 • Published 2 years ago

@indextrus/waitlyst-js v1.0.40

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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);
  1. 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")
1.0.39

2 years ago

1.0.38

2 years ago

1.0.40

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.9

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago