GithubHelp home page GithubHelp logo

allow2 / allow2node Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 5.0 121 KB

Allow2 node SDK for OpenSource Parental Freedom

Home Page: https://Allow2.github.io

License: Other

JavaScript 100.00%
control children freedom child controls quota parental-control parental parent family

allow2node's Introduction

Allow2 - Free and Powerful Parental Controls for your apps and devices

npm package

Build Status Coverage Coverage Dependency Status Known Vulnerabilities Join the chat at https://gitter.im/Allow2/Allow2node

Allow2 makes it easy to add parental controls to your apps.

  1. Why should you use Allow2?
  2. Installation
  3. Concepts
  4. Usage
  5. Playing

Why should you use Allow2?

We remove friction and barriers to entry. Parents are scared of technology and not being able to avoid screen-time addiction or have their children gaming instead of doing homework and chores. GIVE THEM the ability to be in control which will INCREASE your user base and INCREASE your paying users.

But good parental controls are incredibly complex and difficult to get correct, and for a parent there is nothing worse than having to log in or open up yet another parental control interface on another app and reconfigure it every other day.

Allow2 solves these problems once and for all:

  1. Leverage the powerful Allow2 platform completely for free (no developer licensing fees)
  2. Add parental controls in a matter of hours and don't worry about implementing heaps of interfaces.
  3. Show your community responsibility and support parents, this helps to bring more users to your apps.

Really, you should be able to add extensive and powerful parental controls to your apps in a matter of hours or (at most) a couple of days.

The best part is it's not only powerful, but completely free for developers and manufacturers.

Try it out

Test Allow2 in your browser: https://npm.runkit.com/allow2

Use the Allow2 server to create a parent account and add children: https://app.allow2.com

Installation

npm install --save allow2

Concepts

The APIs for Allow2 operate in 2 modes.

DEVICE MODE

In this first API mode, you pair the device or app with the Allow2 Service and use that pairing credential to report all usage.

This mode is used for toasters, lights, routers, gaming consoles, apps, etc. Things that are typically owned by one account or family.

To use this mode, you pair the device/app FIRST and you supply the pairing credentials to the "check" call.

SERVICE MODE

Inthis second API mode, you instead typically only install it once, and it is for service-based systems, social media platforms, web sites, etc. These are not owned by any one family or account, but are used by potentially thousands of people that may not be related (Facebook, Twitter, www.google.com, youtube, etc).

To use this mode, you create a key/secret pair on the Allow2 Developer portal and supply the serviceID and Secret Key to the "check" call.

Usage

There are essentially 2 steps to usage:

  1. pair with the platform (see the example)
  2. use the "check" routine to check permissions and log usage.

With Allow2 all you have to do to check if something can be used and record it's usage is:

var allow2 = require('allow2');
allow2.check({
    userId: 1,
    pairToken: "98hbieg87-ilulieugil-dilufkucy",
    deviceToken: "iug893-kjg-fiug23",
    tz: 'Australia/Brisbane', // note, timezone is crucial to correctly calculate allowed times and day types
    childId: 10,
    activities: [
        { id: 1, log: true },		    // 1 = Internet
        { id: 2, log: true },           // 2 = Conputer
        { id: 3, log: true },           // 3 = Gaming
        { id: 8, log: true }            // 8 = Screen Time - see all "activities" at https://developer.allow2.com
    ],
    log: true                   // use this to say you want usage recorded (logged) as well as checked
    //, staging: true           // specify staging environment (BETA - use at your OWN risk)
}, function(err, result) {
    ... // this is the callback with results of the check
});

Callback:

function callback(err, result) {
    // result = { allowed: true,
            activities: { '7': [Object], ... },
            dayTypes: { today: [Object], tomorrow: [Object] }
    // },
    if (err) {
        // can look into the err object to determine what action to take, do you allow usage?
        // (Children may deliberately kill internet to get free use), or do you require access?
        // Or do you give a grace period and cache the last response while offline?
        return;
    }
    // result.allowed: true/false  // this is the macro feedback on approved/denied.
    // you can dig in to the result.activities object to see the restrictions and bans/etc on each activity,
    // determine when times will run out or next be available and how much quota is remaining for each activity.
    
    // result.dayTypes provides details on what day type it is today and tomorrow.
}

Playing

The best way to 'play' with the sdk and get familiar with it is via the runkit: https://npm.runkit.com/allow2

allow2node's People

Contributors

allow2ceo avatar gitter-badger avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

allow2node's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.