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

fusion-plugin-passport

v0.1.3

Published

The `fusion-plugin-passport`

Downloads

20

Readme

fusion-plugin-passport

The fusion-plugin-passport package provides a PassportJS implementation for FusionJS. This is currently in very early release, it should work, but still lacks tests,flow typings, and some architecture changes are still planned.


Table of contents


Installation

yarn add fusion-plugin-passport

Setup

// src/main.js
import App from 'fusion-react';
import Passport, { PassportConfigToken, UserStoreToken } from 'fusion-plugin-passport';
import UniversalEvents, {
  UniversalEventsToken,
} from 'fusion-plugin-universal-events';
import root from './components/root';

export default function start(App) {
  const app = new App(root);
  app.register(Router);
if (__NODE__) {
    app.register(SessionToken, JWTSession);
    app.register(SessionSecretToken, "some-secret"); // required
    app.register(SessionCookieNameToken, "some-cookie-name"); // required
    app.register(SessionCookieExpiresToken, 86400); // optional
    app.register(PassportConfigToken, [
      {
        /*config is the default Passport Config object*/
        config: {
          clientID: "--------------", // clientID
          clientSecret: "--------------", // app secret
          scope: ["email"], // the scope
          callbackURL: "/auth/facebook/callback",
          profileFields: ["id", "emails", "displayName"] // fields to retrive
        },
        name: "facebook",
        redirect: "/",
        authUrl: "/auth/facebook",
        Strategy: FacebookStrategy
      }
    ]);
    app.register(UserStoreToken, {
      getUserByEmail() {
        return { email: "[email protected]", id: "1298393812093548907" };
      },
      register(ob) {
        console.warn("registered user", ob);
      },
      registerAuthForUser(auth, id, userid) {
        console.warn("NEW AUTH TYPE for user", auth, id, userid);
      }
    });
    app.register(Passport);
  }

  return app;
}

API

Registration API

Plugin
import Passport from "fusion-plugin-passport";

The plugin. The plugin requires a SessionToken to be set to store the current user information. In my examples I use JWT

PassportConfigToken
import { PassportConfigToken } from "fusion-plugin-passport";

A token for registering the passport configuration.

UserStoreToken
import { UserStoreToken } from "fusion-plugin-passport";

A token for registering the UserStoreToken to be used by the plugin to handle registration and user fetching. The user store supports has the following interface:

UserStoreToken Api
 {
    registerAuthForUser(authName : string ,id : string, userId : any ) { ....},
    register({id, email, password}) {

      // Store the user fields to a database
     },
    getUserByEmail(email : string ) {
      let user = await loadFromDatabase(email);
      return user; // this can be anything the only requirment is having a email fields and id field.
    }

Auth Events

The plugin will emit the following events/metrics via the universal events plugin if provided:

Server-side events

None, in the future I want to log login attempts that fail or seem suspicious, but I am still thinkering on how to do so.

Browser events
None