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 🙏

© 2026 – Pkg Stats / Ryan Hefner

shino-onesignal

v0.0.2

Published

Send notification by onesignal

Downloads

12

Readme

Shino-onesignal

Sends notifications to your users

This is an unofficial Node.js SDK for the OneSignal Push Notification Service, which wraps their REST API.

Installing

A step by step series of examples that tell you have to get a development env running


npm install shino-onesignal

Basic Usage

const Shino = require('shino-onesignal')

const appid   = "YOUR_APP_ID",
      apikey  = "YOUR_API_REST_KEY";


const shino = new Shino(appid, apikey);

// variable
var id   = "YOUR_PLAYER_ID",
    ids  = ["YOUR_PLAYER_ID1", "YOUR_PLAYER_ID2", ...],
    tags = {
        key: 'user_id',
        value: 1
    },
    contents  = {
        body: "Message from Hoang Master",
        head: "Hello everyone",
        data: {
            notification_type: 1
        },
        url: 'http://shippy.yez.vn:1337'
    },
    dataEdit = {
        tags: {
            edit_by: "Hoang kun"
        }
        ....
    };


// Send based on OneSignal PlayerIds - Create notification
shino.toIds(contents, ids)

// Send based on filters/tags - Create notification
shino.toTags(contents, tags)

// Send to all subscribers - Create notification
shino.toAll(contents)

// View the details of a single OneSignal app
// Requires your OneSignal User Auth Key
// const shino = new Shino(appid, apikey, authkey);
shino.viewApp()
     .then(data => console.log(data) )
     .catch(e => console.log(e))

// View the details of all of your current OneSignal apps
// Requires your OneSignal User Auth Key
// const shino = new Shino(appid, apikey, authkey);
shino.viewApps()
     .then(data => console.log(data) )
     .catch(e => console.log(e))

// View the details of an existing device in one of your OneSignal apps
shino.viewDevice(id)
     .then(data => console.log(data) )
     .catch(e => console.log(e))


// Update an existing device in one of your OneSignal apps
shino.editDevice(dataEdit, id)
     .then(data => console.log(data) )
     .catch(e => console.log(e))

// View the details of multiple devices in one of your OneSignal apps
shino.viewDevices(start, limit)
     .then(data => console.log(data) )
     .catch(e => console.log(e))
     
// create notification with more options
shino.createNotification({
        contents: {
            contents: "Message from Hoang Master",
            headings:"Hello everybody"
        },
        specific: {
            include_player_ids: ids
        },
        attachments: {
            data: {
                notification_type: 2
            }
        }
    })
    .then(success => console.log(data))
    .catch( e => console.log(e));

Available in Keys & IDs

  • appId(string, required) - your OneSignal App ID

  • restApiKey(string, required) - your OneSignal REST API Key

  • authKey(string) - your OneSignal User Auth Key.

More about

Versioning

Version 0.0.1

Authors

  • Hoang Le - Initial work -

Issue