Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@solucx/survey-js-sdk

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solucx/survey-js-sdk

rm

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
2
Created
Source

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: "fulano@email.com",
  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 maria@email.com
  • 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

FAQs

Package last updated on 29 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts