npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@solucx/survey-js-sdk

v0.1.1

Published

rm

Downloads

6

Readme

SoluCX JS SDK

How to use

  • First you must to configure the SDK Client with your API Key provided by SoluCX.
  • For each survey, you must first require the survey.
  • This step will ask for the server for the current customer. It will return the a Survey or it will throw an error.

Installing

npm install --save @solucx/survey-js-sdk

Using Example

import { Survey } from "@solucx/survey-js-sdk";

const apiKey = "{CHAVE DA API}";

const surveyRequestData = {
  storeId: "1234",
  employeeId: "1234",
  name: "Fulano da Silva",
  email: "[email protected]",
  amount: 1.99,
  journey: "e-commerce",
};


// Creates a survey to be rated
const survey = await Survey.createSurvey(apiKey, surveyRequestData);

// Set User Response
survey.rating = 10;
survey.comment = "Somme Comment";
survey.anonymous = false;

// Set Items score and rating
survey.items[0].score = 1;
survey.items[0].rating = "negative";

survey.items[1].score = 2;
survey.items[1].rating = "positive";

survey.items[2].score = 1;
survey.items[2].rating = "neutral";

// Submit Rating
const result = await survey.submitRating();

Survey Request Data Options

  • transactionId : alphanumeric Field with a unique transaction id from the company itself to establish a direct link in the exports of the reports. - ex 564425232
  • clientId : numeric Field with unique customer id from the company itself to establish a direct link in the exports of - ex reports 3445667
  • storeId : alphanumeric Mandatory Field with unit id from the company itself to establish a direct link in the exports of the reports. Must be registered in the system - ex 12332
  • employeeId : alphanumeric Mandatory Field with id of the employee participating in the sale from the company itself to establish a direct link in the exports of the reports, if not provided a generic will be assigned. - ex 3424342
  • name : Mandatory text Customer Name - ex Maria
  • email : Mandatory text Customer Email - ex [email protected]
  • phone : 10/11-digit Customer Telephone number - ex 11999990000
  • phone2 : numeric Second Customer phone number with 10 or 11 digits - ex 11999991111
  • cpf : Customer CPF number - ex 01234567890
  • gender : "M", "F" or "-" Gender of Customer - ex F
  • birthDate : YYYY-mm-dd Customer Birth Date - ex 1980-12-31
  • amount : positive decimal Mandatory Transaction amount - ex 87.20
  • rating : numeric score that will be marked in the survey, value from 0 to 10. - ex 10
  • journey : Journey of what the customer performed the transaction - ex: e-commerce
  • source : Source that the survey is being collected - ex 'email'

Survey Response Parameters

  • transactionId
  • attemptId
  • storeId
  • employeeId
  • rating
  • comment
  • anonymous
  • items
  • parameters

Survey Parameters

export interface JourneyParameters {
  sendButtonText?: string;
  surveyTitle?: string;
  name?: string;
  logo?: string;
  color?: string;
  question?: string;
  displayType?: DisplayType;
  inputType?: InputType;
  npsColor?: boolean;
  classesLabel?: string;
  commentLabel?: string;
  commentNegativeLabel?: string;
  classesNotRequired?: boolean;
  showClasses?: boolean;
  allowHtml?: boolean;
  showComment?: boolean;
  showAnonymous?: boolean;
  showEmailEnrichment?: boolean;
  showPhoneEnrichment?: boolean;
  showMoreThan6Classes?: boolean;
  showInHouseAds?: boolean;
  customAcknowledgmentHTML?: string;
  showDocumentEnrichment?: boolean;
  showSendButton?: boolean;
  saveInitialRating?: boolean;
  successTitle?: string;
  successMessage?: string;
  thanksMessage?: string;
  dateTimeMessage?: string;
  template?: string;
  customStyle?: string;
  hideCredits?: boolean;
  privacyLinks?: PrivacyLink[];
  preEnrich?: boolean;
}

Items parameters

export interface ClassItem {
  /** id da classe a ser avaliada */
  classId: number;

  /** texto da classe */
  name: string;

  /** Ordem q a classe vai aparecer */
  order: number;

  /** Tipo da classe */
  type: ClassItemType;

  /** Avaliação do item */
  rating?: ClassRating;

  /** Nota do item */
  score?: number