1.1.1 • Published 9 months ago

nps-hero v1.1.1

Weekly downloads
-
License
(c) 2024 by d-aut...
Repository
github
Last release
9 months ago

nps-hero

NPS Hero provides quick and easy nps score collection - check our website www.nps-hero.com for more details

NPM JavaScript Style Guide

Install

npm install --save nps-hero

Demo Implementations

Demo Page

Check one of our demo pages below:

plain Html example

reactJs

Usage

get the npsHeroApiKey, npsHeroCustomerId and npsHeroQuestionnaireId from the nps-hero.com dashboard.

ReactJs

import React from 'react'

import NPSInput from 'nps-hero';
import "nps-hero/dist/styles.css";

const App = () => {

    return <NPSInput
                     customOrUserIdentifier={"yourCustomOrUserIdentifier - e.g. the user id"}
                     referenceId="yourReferenceId - e.g. the customer id or productname"
                     npsHeroApiKey="npsHeroApiKey"
                     npsHeroCustomerId="npsHeroCustomerId"
                     npsHeroQuestionnaireId="npsheroQuestionnaireId" 
    />
}

Plain Html

if you prefer using plain html, you can include the script tag in the head of your html file.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Sample Page with NPS</title>

  <script src="https://nps-hero.com/js/nps-widget.js"
          data-nps-hero-customer-id="npsHeroCustomerId"
          data-questionnaire-id="npsheroQuestionnaireId"
          data-reference-id="your-referenceId"
          data-customer-or-user-identifier="your-customOrUserIdentifier"
          data-nps-hero-api-key="npsHeroApiKey"
          async></script>
</head>
<body>
<h1>Example of NPS-Hero</h1>
<p>Included by javaScript Tag in the Head</p>
</body>
</html>

Parameter

💡 Important: you either need to set the 'customOrUserIdentifier' or the 'referenceId' parameter, you can also use both. At least one is required.

Here is the parameter list:

ParameterDescriptionTypeRequired
customOrUserIdentifieryourCustomOrUserIdentifier - e.g. the user idstringxOr
referenceIdyourReferenceId - e.g. the customer id or productnamestringxOr
npsHeroApiKeynpsHeroApiKeystringtrue
npsHeroCustomerIdnpsHeroCustomerIdstringtrue
npsHeroQuestionnaireIdyourQuestionnaireIdstringtrue
loadDataDynamicallyif true the texts, etc will be loaded dynamically, otherwise define with the param*-Fieldsbooleanfalse
paramMessagethe message to be displayedstringfalse
paramSuccessMessagethe success message to be displayed after the rating has been given if the rating is above the thresholdstringfalse
paramPlaceHolderTextthe placeholder text for the input field, shown if the rating is below the thresholdstringfalse
parmFeedbackHeaderthe header text for the feedback section, shown if the rating is below the thresholdstringfalse
paramScoreThresholdForFeedbackthe threshold for the feedback section to be shown, default is 7numberfalse

License

© d-automation gmbh

1.1.1

9 months ago

1.1.0

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago