1.14.2 • Published 17 days ago

qualtive-web v1.14.2

Weekly downloads
149
License
ISC
Repository
github
Last release
17 days ago

Qualtive Client Library for Web

Installation

Using npm

npm install qualtive-web

Using yarn

yarn add qualtive-web

TypeScript types are included in this package.

Usage

First of all, make sure you have created a question on qualtive.io. Each feedback entry is posted to a so called collection (ID) which can be found in the question page.

Using Built-in UI

To present a feedback form, use the present-function. For example:

import * as qualtive from "qualtive-web"

qualtive.present("my-company/my-question")

There is a few options to customize the UI. For example:

import * as qualtive from "qualtive-web"

qualtive.present("my-company/my-question", {
  title: "Leave feedback",
  supportURL: "https://link-to-your-customer-service/", // If present, this will show a link to your customer support.
  locale: "en-US", // Optional. The language and formatting to use. Defaults to the device default.
})

If users can login on your site, you can include a user property describing the user. For example:

import * as qualtive from "qualtive-web"

qualtive.present("my-company/my-question", {
  user: {
    id: "user-123", // Authorized user id. Used to list feedback from the same user. Optional.
    name: "Steve", // User friendly name. Can be the users full name or alias. Optional.
    email: "steve@gmail.com", // Reachable email adress. Optional.
  },
})

You can even include custom attributes that will be shown on qualtive.io. For example:

import * as qualtive from "qualtive-web"

qualtive.present("my-company/my-question", {
  customAttributes: {
    age: 22,
  },
})

Using Custom UI

To post a feedback entry, use the post-function. For example:

import * as qualtive from "qualtive-web"

qualtive.post("my-company/my-question", {
  score: 75, // Score between 0 and 100 where 0 is saddest and 100 is happiest.
  text: "Hello world!", // Optional user typed text.
})

If users can login on your site, you can include a user property describing the user. For example:

import * as qualtive from "qualtive-web"

qualtive.post("my-company/my-question", {
  score: 75,
  user: {
    id: "user-123", // Authorized user id. Used to list feedback from the same user. Optional.
    name: "Steve", // User friendly name. Can be the users full name or alias. Optional.
    email: "steve@gmail.com", // Reachable email adress. Optional.
  },
})

You can even include custom attributes that will be shown on qualtive.io. For example:

import * as qualtive from "qualtive-web"

qualtive.post("my-company/my-question", {
  score: 75,
  customAttributes: {
    age: 22,
  },
})

Supported languages

The built-in UI supports the following languages:

  • English
  • Swedish
1.14.2

17 days ago

1.14.1

1 month ago

1.14.0

1 month ago

1.13.0

9 months ago

1.12.0

1 year ago

1.11.1

1 year ago

1.11.0

2 years ago

1.9.0

2 years ago

1.10.0

2 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.6.2

3 years ago

1.7.0

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago