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

blockstarter-wl

v0.0.49

Published

Blockstarter white-label API for integration

Downloads

45

Readme

Blockstarter White Label API (Blockstarter Enterprise)

This is library helps to integrate blockstarter with client's dashboard

Image

Install

npm i blockstarter-wl

Available functions

  • auth
  • logout
  • confirmEmail
  • forgotPassword
  • resetPassword
  • changePassword
  • updateProfile
  • panel
  • address
  • contributors

Usage

First of all define a storage


var storage = {
    isBrowser: true,  //=> you cannot duplicate requests for browser
    baseUrl: "http://server.url",
    sessionId: null,
    apiKey: 'TEST-APIKEY',
    dashboard: null
  };

Auth

Login or Register


var blockstarter = require('blockstarter-wl');

if (storage.apiKey == null) {
  throw "API Key is required";
}

blockstarter.auth({
  isBrowser: storage.isBrowser,
  baseUrl: storage.baseUrl,
  email: '[email protected]',
  password: 'unique password',
  confirmUrl: "http://redirect-on-confirm" // will redirect here http://redirect-on-confirm?confirmation-id=XXXXX
  project: 'KickCity',
  reference: 'traffic-source',
  apiKey: storage.apiKey

}, function(err, session){
      if (err != null) {
        throw err;
      }
      
      if (session.sessionId == null) {
        throw "Session ID is missing";
      }
      
      storage.sessionId = session.sessionId;
      console.log(session.sessionId);
});

Logout

Remove sessionId from the system

Confirm Email

Send confirmation-id and session-id to confirm email

Documentation is not ready

Forgot password


if (storage.apiKey == null) {
      throw "API Key is required";
}

var request = {
    isBrowser: storage.isBrowser,
    baseUrl: storage.baseUrl,
    apiKey: storage.apiKey,
    email: "[email protected]",
    project: "KickCity",
    transport: "[email protected]",
    returnUrl: "http://restore-password.com" //server will invoke http://restore-password.com?restore-key=SOME_RANDON_KEY
}
    
blockstarter.forgotPassword(request, function(err, dashboard){
  if (err != null) {
    throw err;
  }
  
  console.log("done");
});

Reset password

User obtains email message with restore password link and then user fills the form. You should obtain restore-key from query params and send it to the server

  

if (storage.apiKey == null) {
      throw "API Key is required";
}

var request = { 
    isBrowser: storage.isBrowser,
    baseUrl: storage.baseUrl,
    apiKey: storage.apiKey,
    newPassword: "newPassword",
    transport: "[email protected]",
    restoreKey: "Obtain restore key from ?restore-key=SOME_RANDON_KEY"
}
    
blockstarter.resetPassword(request, function(err, dashboard){
  if (err != null) {
    throw err;
  }
  
  console.log("done");
});

Change password

Change password when session is created and user is online

  
if (storage.apiKey == null) {
      throw "API Key is required";
}

if (storage.sessionId == null) {
      throw "Session is required";
}

var request = {
    isBrowser: storage.isBrowser,
    baseUrl: storage.baseUrl,
    apiKey: storage.apiKey,
    sessionId: storage.sessionId,
    newPassword: "newPassword",
    oldPassword: "oldPassword",
    transport: "[email protected]"
}
    
blockstarter.changePassword(request, function(err, dashboard){
  if (err != null) {
    throw err;
  }
  
  console.log("done");
});

Update Profile

Almost like changePassword but can update email, username, address optionaly

Documentation is not ready

Get Dashboard

Information about Totals, Rates, Currencies, etc. in order to build a main screen where contributor can

  1. get address to send money
  2. check his transactions
  3. check common information about project
  4. get total raised (progress)
  
if (storage.sessionId == null) {
      throw "Session is required";
}

if (storage.apiKey == null) {
      throw "API Key is required";
}
    
blockstarter.panel(storage, function(err, dashboard){
  if (err != null) {
    throw err;
  }
  
  storage.dashboard = dashboard;
  
  console.log(dashboard);
});

Get Address

Get [btc, ltc, eth, waves, dash, zec] address


if (storage.sessionId == null) {
  throw "Session is required";
}

if (storage.apiKey == null) {
  throw "API Key is required";
}

if (storage.dashboard == null) {
  throw "Dashboard is required";
}

var request = {
   isBrowser: storage.isBrowser,
   baseUrl: storage.baseUrl,
   apiKey: storage.apiKey,
   sessionId: storage.sessionId,
   dashboard: storage.dashboard,
   type: 'ltc'
}   

blockstarter.address(request, function(err, addressInfo){
  if (err != null) {
    throw err;
  }
  console.log(addressInfo);
});

Ask for help

User can ask for help and admin will contact him by email


if (storage.sessionId == null) {
  throw "Session is required";
}

if (storage.apiKey == null) {
  throw "API Key is required";
}

blockstarter.helpMe(storage, function(err, info){
  if (err != null) {
    throw err;
  }
  console.log('done')
});

List of contributors

Get list of contributors for administrator


if (storage.apiKey == null) {
  throw "API Key is required";
}

var request = { 
   isBrowser: storage.isBrowser,
   baseUrl: storage.baseUrl,
   apiKey: storage.apiKey,  
   project: "KickCity"
}

blockstarter.contributors(request, function(err, list){
  if (err != null) {
    throw err;
  }
  console.log(list)
});