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

@citibot/auth

v1.1.0

Published

This bundle manages auth0 authentication for citibot applications.

Downloads

7

Readme

Auth Bundle

This bundle manages auth0 authentication for citibot applications.

Getting Started

Install the bundle

yarn add @citibot/auth

Set Environment Variables

AUTH0_DOMAIN=citibot.auth0.com
AUTH0_CLIENTID=[your apps client id]

If using the citibot app template, remember to add the env replace keys to your rollup.config.js. (see https://github.com/citibot/template for details)

Set up callback route

In the routes.js bundle, you will want to create a url for your callback handler.

import Authenticate from '../pages/Authenticate.html'

{
  ...
  '/callback': Authenticate
}

Create Authenticate.html page

<script>
import { store, reduxBundler } from '../store'
import { onMount } from 'svelte'

const { selectLoggedIn, doHandleAuthentication, doUpdateUrl } = reduxBundler

onMount(() => {
  store.subscribe(() => {
    if (selectIsLoggedIn()) {
      doUpdateUrl('/home') // redirect to authenticated page
    }
  })


 doHandleAuthentication() 

})


</script>
<section>
  <p>Logging In</p>
</section>
<style>
  section {
    display: flex;
    align-items: center;
    justify-content: center;
  }
</style>

Validate authentication for each authenticated page

TODO: Add example

In each data bundle using the selectAccessToken selector to get the access token for authentication.

TODO: Add example


Also supports passwordless authentication, in this case you will want to use the action creators - doPasswordlessStart and doPasswordlessLogin.

See https://auth0.com/docs/connections/passwordless/spa-sms#use-your-own-ui

for more details.


Testing

Use tape-modern and nock to create tests that call the redux bundle by calling action creators and mocking the external api calls to confirm that the selectors are updated correctly for the following scenarios.

  • Login
  • Logout
  • RenewToken
  • ScheduleRenewToken