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

osso-nodejs-example

v1.0.0

Published

Example NodeJS express app for integrating Osso

Downloads

6

Readme

Osso NodeJS Example

This repository contains a new NodeJS Express application with the bare minimum work to demonstrate how to integrate Osso.

Osso integration

Osso promises an easy integration to your Rails app. We provide an passportjs provider package passport-osso to make integration a breeze.

Running the example

This example can be run locally or in production. Osso provides a demo Osso instance and a Fake IDP (repo | application) that allow you to run this example and perform the full authentication flow.

The Osso demo instance reseeds it's database every hour, but is seeded with most of the data needed to run this example application.

An OAuth Client with a client ID demo-client-id and client secret demo-client-secret will always be available - use these in your ENV by either copying the .env.sample or by deploying to Heroku which will use the values from app.json.

You must however ensure that a Redirect URI exists on the demo instance allow list. If you run locally, you should be all set - http://127.0.0.1:3000/users/auth/osso/callback is always present for the demo OAuth client. If you run in production, you must set the production URL in your env as OSSO_REDIRECT_URI using the same path, i.e. https://my-osso-example.herokuapp.com/users/auth/osso/callback. You then must add that same value to the demo instance - choose the Demo Production OAuth client here and add your redirect URI: https://demo.ossoapp.com/admin/config

The Osso demo instance also includes a customer for example.com with Osso's Fake IDP configured as an Identity Provider. When attempting to sign in to this app, you must use an email address with the domain example.com. You'll then need to log in to the Fake IDP with the example.com email and any value as the password.

If authentication is successful, a barebones json object for the authenticated user will be rendered by this application.

You can also use this demo app against your own Osso instance. Change the client_options.site value in the Devise initializer to match the URL of your instance. You'll also then be responsible for setting OAuth client ENV vars specific to the OAuth clients in your instance.

Locally

You can run the application locally by cloning the repo. Rename .env.sample to .env and start the server with rails s.

Use [anything]@example.com as the email address for signing in.

Heroku

This app can be deployed to Heroku - the deployed app will have the OSSO_CLIENT_ID and OSSO_CLIENT_SECRET ENV vars set for the Osso demo instance.

You will need to set one ENV variable, OSSO_REDIRECT_URI. It should be https://YOUR_APP_NAME.herokuapp.com/users/auth/osso/callback. You then must add that same value to the demo instance - choose the Demo Production OAuth client here and add your redirect URI: https://demo.ossoapp.com/admin/config. The demo instance reseeds its database every hour, so this is only intended for demo purposes. Trying to use the demo instance as a production system will not work.

Deploy

Elsewhere

Totally possible, but you're on your own! Just make sure you set the three ENV variables and you should be good to go.