1.0.0 • Published 3 years ago

qualtive-node v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Qualtive Client Library for Node

Installation

Using npm

npm install qualtive-node

Using yarn

yarn add qualtive-node

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.

Posting feedback

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

import * as qualtive from "qualtive-node"

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.
  user: {
    clientId: "34851e75-de80-4f5b-9dbe-89dbd8295089", // Uniq identifier for the client the feedback was sent from.
  },
})

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

import * as qualtive from "qualtive-node"

qualtive.post("my-company/my-question", {
  score: 75,
  user: {
    clientId: "34851e75-de80-4f5b-9dbe-89dbd8295089",
    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-node"

qualtive.post("my-company/my-question", {
  score: 75,
  user: {
    clientId: "34851e75-de80-4f5b-9dbe-89dbd8295089",
  },
  customAttributes: {
    age: 22,
  },
})