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

node-delighted

v0.0.1

Published

NodeJS module for interacting with the Delighted API

Downloads

10

Readme

NodeJS module for the Delighted API

Delighted is the easiest and most beautiful way to measure customer happiness. Are your customers delighted?

Site: https://delightedapp.com

API Docs: https://delightedapp.com/docs/api

Using this module

To use this module, you will need a Delighted account with an API key.

Install the module

npm install delighted

Instantiate the delighted module

var Delighted = require('delighted');

var delighted = new Delighted('DELIGHTED_API_KEY');

Creating a person to send an email to


Create or update a person and schedule a survey email.

Valid options:

@string email  				- Email of the person (required)
@string name  				- Name of the person
@integer delay 				- The time in seconds to wait before sending the survey email. Default is 0 which will send immediately
@properties object 			- Custom properties to associate with the sent survey
@boolean send 				- Set to false if you do not want to send a survey email. The default is true.

var options = {
	email: '[email protected]'
};

delighted.person.create(options)
.then(function(response){

})
.fail(function(error){

});

Delete a pending survey request

Remove all pending (i.e. scheduled in the future, but not yet sent) survey requests for a given person

Valid options:

@string email 				- Email of the person you want to delete scheduled surveys for. (required)

delighted.surveyRequest.deletePending(email)
.then(function(response){

})
.fail(function(error){

});

Create a survey response

Create a survey response (i.e. a score and comment from a person).

Valid options:

@string person 				- The ID of the person responding. (required)
@object person_properties 	- Custom properties to associate with this response.
@integer score 				- Score of the response, from 0 to 10. (required)
@string comment 			- An optional comment that the person left when responding.


delighted.surveyResponse.create({
    person: '1234',
    score: 7
})
.then(function(response){

})
.fail(function(error){

});

List survey responses

Retrieve all survey responses for your account.

Results are returned in creation order, with the oldest item first, and are paginated. See the parameters section below for more information regarding the pagination parameters.

Valid options:

@integer per_page 			- Number of results to return per page. The default is 20. The maximum is 100.
@integer page 				- The page number to return. The default is 1.
@integer since 				- An optional Unix timestamp to restrict responses to those created on or after this time. Formatting example (for 1 hour ago): "1397592449".
@integer until 				- An optional Unix timestamp to restrict responses to those created on or before this time. Formatting example (for the current time): 1397596049.
@string trend 				- An optional ID of a trend to restrict responses to that trend. To obtain the ID for a trend, visit the trends page. For example, if the URL for the desired trend ends with /trends/1234 the ID of that trend is 1234.
@string order   			- An optional sort order for the responses. The default is asc, which will return responses in chronological order (oldest first). To get responses in reverse chronological order (newest first), specify desc.
@array expand 				- By default, only the person id is included in the response. If you want the full person object included, pass expand[]=person.

delighted.surveyResponses.all({
	per_page: 10,
	page: 1
})
.then(function(response){

})
.fail(function(error){

});

Get metrics

Retrieve metrics for your account (includes your NPS® score and response breakdown).

Valid options:

@integer since 				- An optional Unix timestamp to restrict metrics to those created on or after this time. Formatting example (for 1 hour ago): 1397592449.
@integer until 				- An optional Unix timestamp to restrict metrics to those created on or before this time. Formatting example (for the current time): 1397596049.
@string trend 				- An optional ID of a trend to restrict metrics to that trend. To obtain the ID for a trend, visit the trends page. For example, if the URL for the desired trend ends with /trends/1234 the ID of that trend is 1234.

delighted.metrics.retrieve({
	since: 1397592449
})
.then(function(response){

})
.fail(function(error){

});