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

@prek-no/intellipush-sdk

v1.5.0

Published

![https://www.intellipush.com/](https://www.intellipush.com/wp-content/uploads/2021/03/IP-logo-mobile.png "Intellipush logo")

Downloads

3

Readme

https://www.intellipush.com/

Unofficial Nodejs SDK for Intellipush

This SDK is actively developed and maintained by Prek AS - an official Intellipush partner.

For compatibility with Node.js versions < 12, please install the globalThis polyfill.

Installation

Add @prek-no/intellipush-sdk dependency to your project:

npm install @prek-no/intellipush-sdk

or using Yarn

yarn add @prek-no/intellipush-sdk

TypeScript

This package delivers its own typings. If you have any problems with typings, add the package to the types array in your tsconfig.json:

{
  "compilerOptions": {
    "types": [
      "@prek-no/intellipush-sdk"
    ]
  }
}

Initialize client

Initialize the Intellipush Client by passing in the credentials:

// const globalThis = require('globalthis')(); // uncomment if NodeJS < NodeJS versions < 12
import { Intellipush } from '@prek-no/intellipush-sdk'

const intellipush = new Intellipush({
    clientId: '<client_id>', // e.g process.env.INTELLIPUSH_CLIENT_ID
    clientSecret: '<client_secret>', // e.g process.env.INTELLIPUSH_CLIENT_SECRET
    proxyUrl: '<proxy_url>' // Optional Proxy URL
})

Authentication

You can sign in using OAuth2 (Client Credentials) by calling the authenticate method:

// Async
try {
    await intellipush.authenticate()
} catch(err: any) {
    console.log(err)
}

// Promise
intellipush.authenticate().then(() => {
    console.log('Authenticated!')
}).catch(() => {
    console.log('Authentication failed!')
})

Models

This SDK provides you with some convenient data models. All models accepts an object in the constructor as well as some setter functions. See example below.

Initialize model with an object.

const contact = new ContactModel({
    name: 'Tim Cook',
    countrycode: '0047',
    phonenumber: '12345678'
})

const result: IContactResponse = await intellipush.contact.create(contact)

console.log(result.data.name)

Initialize without object, use setters

const contact = new ContactModel()

contact.setName('Tim cook')
    .setCountrycode('0047')
    .setPhonenumber('12345678')
    .setEmail('[email protected]')

const result: IContactResponse = await intellipush.contact.create(contact)

console.log(result.data.name)

Initialize with object and override with setters

const contact = new ContactModel({
    name: 'Tim Cook',
    countrycode: '0047',
    phonenumber: '12345678'
})

contact.setName('Howard Stewart')

const result: IContactResponse = await intellipush.contact.create(contact)

console.log(result.data.name)

Run without using data model

Since the Data Models is really just an object, you can also pass an object directly to the API methods:

const result: IContactResponse = await intellipush.contact.create({
    name: 'Tim Cook',
    countrycode: '0047',
    phonenumber: '12345678'
})

console.log(result.data.name)

Development status

  • [X] Authentication
    • [X] authenticate
    • [X] getToken
    • [X] setToken
  • [X] API Resources
    • [X] Contact
      • [X] create
      • [X] update
      • [X] get
      • [X] getContacts
      • [X] delete
    • [X] ContactList
      • [X] create
      • [X] update
      • [X] get
      • [X] getContactLists
      • [X] getContactsInList
      • [X] addContact
      • [X] removeContact
      • [X] delete
    • [X] SMS
      • [X] create
      • [X] createScheduled
      • [X] createBatch
      • [X] getPlanned
      • [X] getSent
      • [X] getUnsent
      • [X] getReceived
      • [X] status
      • [X] delete
    • [X] TwoFactor
      • [X] generate
      • [X] validate
    • [X] Url
      • [X] generate
      • [X] generateChild
      • [X] details
    • [X] User
      • [X] me

Need help? Feel free to contact us.

MIT