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

@gatsby-themes/okta

v1.0.2

Published

Okta Integration for Gatsby

Downloads

7

Readme

Gatsby Okta Theme

The okta theme sets up the okta integration.

How to use

  • Add the dependency @gatsby-themes/okta

  • Setup Okta for Web SSO and configure the application and users

    • Grant Types : Implicit (Access Token, ID implicit)
    • Login Redirect URI: localhost:8000/
  • Configure the environment with the following:

    • OTKA_BASE_URL: Okta Base URL
    • OTKA_LOGO: Okta company logo
    • OTKA_CLIENT_ID: Okta Client ID
  • The core theme will warn of the peer dependencies which also must be added to the gatsby site leveraging this theme.

  • The dependencies include:

    • "gatsby": "^2.13.21"
    • "@okta/okta-signin-widget": "^3.0.6"
    • "dotenv": "^8.0.0"
yarn add `@gatsby-themes/okta`
  • Configure the theme in the gatsby-config.js file.
module.exports = {
	plugins: [
		{
			resolve: '@gatsby-themes/okta',
		},
	],
}
  • This theme uses Context APIs to provide the state of the user authentication
  • The steps to use the Context API via the AuthContext object - The ideal place to use this in a HOC component like Layout which is wrappers all the pages.
  • In the render method setup the AuthContext consumer
  • The user will be set to the email.id of the logged in user , otherwise it will be false validateUser(). Call this if the current page requires authentication, so that the session is validated
import { AuthContext } from '@gatsby-themes/okta';
...
return (
	<AuthContext.Consumer>
		{({ user, validateUser }) => {
			// call if the current page requires authentication
			if (requiresAuth) {
				validateUser();
			}
			...
			// Define the div where the okta widget can be displayed
			// modify the styles to either show or hide the widget
			<div
				id="okta"
					style={oktaIDStyles(requiresAuth && user === false)}
					/>
		}
  • In the header component we can then display the logged in user and the option to log out
  • Use the logoutUser() context method to log out the user
  • The user will be set to the email.id of the logged in user , otherwise it will be false
	<AuthContext.Consumer>
			{({ user, logoutUser }) => {
				....
				{
					user &&
				(
					...
					<MenuItem onClick={() => logoutUser()}>Log out</MenuItem>)
			}
			}}

okta-app with sample code

  • The demo is available here