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

gigya-api-wrapper

v1.0.5

Published

A simple Gigya JS api wrapper which works with promises.

Downloads

1,397

Readme

Gigya API wrapper

This is a simple Gigya JS api wrapper which works with promises and should make life easier for developers working with Gigya markup extensions.

Scope

Currently this library does not include the custom JS registration, login and password reset API functions as it is intended to be used next to the Gigya markup extensions. The Gigya Markup extensions deal with the registration, account linking, password reset and other flows on their own as long as you add the proper data and class attributes on their HTML.

A later release might possibly contain the other API functions so you can code a completely custom Gigya RaaS implementation.

How to use...

  npm i gigya-api-wrapper

Initialisation

import GigyaWrapper from 'gigyaWrapper';

this.gigyaWrapperInstance = new GigyaWrapper({
  apiKey: '<api_key>',
  containerID: 'wrapper',
  screenSet: 'screen-set', // could be on gigya's servers or local
  lang: 'en',
  autoLogin: true,
  debug: false,
  https: true
});

// Listen to the async load event of the Gigya library.
this.gigyaWrapperInstance.onLibraryReady().then( ( gigyaObject )=>{
  // do stuffs
});

A common use case

Initialise like the above code sample.

// Listen to user events
this.gigyaWrapperInstance.registerEventListeners({
  onLogin: ()=>{ /* show profile */ },
  onLogout: ()=>{
    //shortcut for the showScreenSet function.
    this.gigyaWrapperInstance.showLoginScreen();
  }
});

this.gigyaWrapperInstance.checkLoggedInStatus().then( ( response )=>{
    if( response.loggedIn ){
      // show profile
    }
    else {
      this.gigyaWrapperInstance.showLoginScreen();
    }
  }
});

Other common functions

Remember to always initialise (onLibraryReady()) first so the Gigya object is available.


// Return promises
this.gigyaWrapperInstance.getAccountInfo();
this.gigyaWrapperInstance.logout();
this.gigyaWrapperInstance.getSchema();
this.gigyaWrapperInstance.getPolicies();
this.gigyaWrapperInstance.getScreenSets();

// ScreenSet handling
// See esdoc directory for all property explanations
this.gigyaWrapperInstance.showLoginScreen();

this.gigyaWrapperInstance.showScreenSet({
  screenSet: 'screen-set',
  containerID: 'wrapper',
  startScreen: 'gigya-login-screen'
});

this.gigyaWrapperInstance.hideScreenSet({
  screenSet: 'screen-set',
  containerID: 'wrapper'
});

// Sharing
// See esdoc directory for all property explanations
this.gigyaWrapperInstance.share({
  provider: 'facebook',
  url: 'http://timbenniks.nl',
  title: 'Tims website',
  subtitle: 'Times website subtitle',
  description: 'Tims website is pretty cool man',
  imageurl: 'http://timbenniks.nl/assets/favicon.png'
});

Development

You need to have node and npm installed to be able to work on this code. If you intend to add or change code you will need to re-render the esdoc.

Install esdoc

npm install -g esdoc

Run esdoc

esdoc -c esdoc.json

Installation

npm install

Tests

npm run test

Dev

npm run dev

Build

npm run build