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

inweb-survey

v1.3.0-beta

Published

In Web channel for CloudCherry CEM platform

Downloads

7,512

Readme

Built With Stencil

Inweb Survey

Cloudcherry brand logo

Web component as a channel for CEM for CloudCherry users. Light weight, deploy and forget tool for online feedback collection.

Looking for subtle non-intrusive channel to collect feedback from online platforms? Inweb Survey (CC Nanosurvey) is here to help. Supports 'Yes/No', 'Star', 'Smiley' questions. This can be followed up with a 'Single Answer' drop down question.

Nanosurvey sample

Measure quality of your website content or find out what went wrong with online experience. Correlate this data with CEM data from other channels. Take necessary course correction. Delight your customers.

Reach out to Support ([email protected]) to deploy this channel in bulk for your brand.

Getting Started

To start using this channel within your web application, follow one of below methods.

Script Tag

  • Add following script tags
    <script type="module" src='https://unpkg.com/inweb-survey/dist/inweb/inweb.esm.js'></script> <script nomodule src='https://unpkg.com/inweb-survey/dist/inweb/inweb.js'></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc.

Node Modules

  • npm install inweb-survey
  • Put a script tag similar to this <script type="module" src='node_modules/inweb-survey/dist/inweb/inweb.esm.js'></script> <script nomodule src="node_modules/inweb-survey/dist/inweb/inweb.js"></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc.

In a stencil-app-starter app

  • Run npm install inweb-survey --save
  • Add an import to the npm packages: import inweb;
  • Then you can use the element anywhere in your template, JSX, html etc.

Using this component

<cc-inweb id="widget-usability" question="How are you today?" token="PC-56874" question-id='5c272306c3d98742b0f7d577'>
</cc-inweb>
  • question will be shown to user with thumbs up and down
  • token - survey token from CloudCherry CEM platform
  • question-id - id of the question from CloudCherry CEM platform

Prefill user information

Below the html tag, add the following code in a script tag

<script>
    // Sample usage for a section in a page
    // Avoid using inweb as variable name,it overwrites the global sdk

    var _inweb = document.querySelector('#widget-usability');

    _inweb.prefills = {
      '59f0762ed50981ce6442dab4': 'Alex',
      '5c272306c3d98742b0f7d576': 'Widgets',
    }
</script>
  • prefills is a dictionary with keys as question ids from CloudCherry CEM Platform and values are the prefill answers
  • These prefills will be submitted along with users response.

listen to response submission event

Every interaction to the component will emit an event on submission. Listen for cc-inweb-response event on the document as shown below

<script>
    document.addEventListener('cc-inweb-response', function ($event) {
      if($event.target.attributes.id === 'widget-usability'){
        <!-- react to response submission -->
      }
    })
</script>

$event.detail has the following payload

  • question has the current question shown to us
  • response is the user's choice of the answer. It would be 'true' or 'false'
  • prefills prefills that was submitted along with response
  • responseAsAnswer response as an answer format suitable for Cloudcherry CEM platform

Conditional Thank you text

Show different thank you texts based on user's response. Below script sets the property to the already added component.

<script>
  _inweb.conditionalThankYou = {
    'yes': 'Thank you for your positive feedback',
    'no': 'Sorry for the inconvinience'
  }
</script>

Hide icons

Not fond of thumbs? you can now show plain text instead of icons. Set the property 'icons' to 'hide'. This can be set in the html as property or set via Javascript

<script>
  _inweb.icons = 'hide';
</script>

Set a different identifier for cookie

You can set different cookie property for the component to use. Set in html using 'cookie-id' attribute or use the property 'cookieId' in JS

<script>
  _inweb.cookieId="my-cookie-name";
</script>

Throttle Survey for varying duration

Surveys are throttled by 3 days by default. You can set the attribute 'throttle-for-days' in html or set in Javascript using 'throttleForDays';

<script>
  _inweb.throttleForDays = 30;
</script>

Hide after submission

While throttling, you can choose to show the survey or hide it.

<script>
  _inweb.hideAfterSubmission = true;
</script>

Show followup question as drop down

You can show follow up options from each answer. This will show up once user answers a question. Add a followup question to post the response to.

_inweb.followUpQuestions = {
        Yes: ["Content", "Right to the point!"],
        No: ["Too Lengthy", "Does not makes sense"]
      };
_inweb.followUpQuestionId = "5c272306c3d98742b0f7d577";

If you need these options to be recorded as two different questions, use the following syntax.

_inweb.followUpQuestions = {
        Yes: {
          id: "5c272306c3d98742b0f7d577", // Positive followup question id
          multiSelect: ["Content", "Right to the point!"]
        },
        No: {
          id: "5c272306c3d98742b0f7d578", // Negative followup question id
          multiSelect: ["Too Lengthy", "Does not makes sense"]
        }
      };
_inweb.followUpQuestionId = "5c272306c3d98742b0f7d577";

Use survey configuration from dashboard

You can use the survey configuration from the CloudCherry dashboard. It will pick the first question (primary) that is supported and render it inline."Star-5", "Smile-5", "Select". Any following Single Select question with tag 'follow-up' will be take as follow up question. You can configure the conditions in the platform to show different followup options. A follow up question can have only on condition to it (dependent on primary question). You will also be able to take advantage of partial submission (if enabled from dashboard).

 <cc-inweb id="feedback" use-token="true" token="MR-13286"></cc-inweb>

Customize the component for your brand

Use css variables to set custom styles to the component

| Variable name | Functionality | Default | | ------------------------ | :---------------------- | ------------------------------- | | --cc-inweb-color | Text color | #6a6a6a | | --cc-inweb-font-weight | Font Weight | 400 | | --cc-inweb-font-size | Font Size | 15px | | --cc-inweb-font-style | Font Style for text | italic | | --cc-inweb-yes-color | Color for Yes icon/text | --cc-inweb-color or #6a6a6a | | --cc-inweb-no-color | Color for No icon/text | --cc-inweb-color or #6a6a6a | | --cc-inweb-icon-size | Size of icons | --cc-inweb-font-size or 15px | | --cc-inweb-icon-margin | margin between icons | --cc-inweb-icon-margin or 6px |

Usage

Set style across the web page

<body style="--cc-inweb-color:blue">
</body>

Set style for one widget

<cc-inweb style="--cc-inweb-color: blue"></cc-inweb>

<cc-inweb style="--cc-inweb-color: red"></cc-inweb>

Position the follow up drop down

Show followup options above or below the question. By default, opens up above.

_inweb.position = 'above';
_inweb.position = 'below';

Multiline support

Show followup question with displayType as 'Multiline'