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

@neohr/sdk

v1.0.0

Published

SDK for embedding NEO platform in your application

Downloads

97

Readme

@neohr/sdk

SDK for embedding NEO platform in your application via iframe with SSO authentication.

Installation

NPM

npm install @neohr/sdk

Script Tag (CDN)

<script src="https://unpkg.com/@neohr/sdk"></script>

Quick Start

import { createNeoSDK } from '@neohr/sdk';

const sdk = await createNeoSDK({
  neoOrigin: 'https://acme.neohr.io',
  mintToken: async () => {
    const res = await fetch('/mint', { method: 'POST' });
    const { jwt } = await res.json();
    return jwt;
  },
  redirectTo: '/people',
  container: document.getElementById('neo-container'),
  on: {
    ready: () => console.log('NEO iframe ready'),
    authenticated: () => console.log('User authenticated'),
    error: (err) => console.error('Error:', err),
    backdropVisible: () => console.log('Modal/drawer opened'),
    backdropHidden: () => console.log('Modal/drawer closed'),
  },
});

Using an Existing iframe

import { NeoSDK } from '@neohr/sdk';

const iframe = document.getElementById('my-iframe') as HTMLIFrameElement;

const sdk = new NeoSDK({
  neoOrigin: 'https://acme.neohr.io',
  mintToken: async () => {
    const res = await fetch('/mint', { method: 'POST' });
    const { jwt } = await res.json();
    return jwt;
  },
  iframe,
  redirectTo: '/people',
});

await sdk.init();

Using via Script Tag

When loaded via <script> tag, the SDK is available as window.NeoSDK:

<script src="https://unpkg.com/@neohr/sdk"></script>
<script>
  const sdk = new NeoSDK.NeoSDK({
    neoOrigin: 'https://acme.neohr.io',
    mintToken: async () => {
      const res = await fetch('/mint', { method: 'POST' });
      const { jwt } = await res.json();
      return jwt;
    },
    container: document.getElementById('neo-container'),
    redirectTo: '/people',
  });

  sdk.init();
</script>

Configuration

| Option | Type | Required | Description | |--------|------|----------|-------------| | neoOrigin | string | Yes | NEO platform origin URL | | mintToken | () => Promise<string> | Yes | Async function that returns a JWT from your backend | | redirectTo | string | No | Initial path to navigate to after auth | | iframe | HTMLIFrameElement | No | Existing iframe element to use | | container | HTMLElement | No | Container for auto-created iframe (defaults to document.body) | | on | NeoSDKEventHandlers | No | Event callbacks |

Events

| Event | Description | |-------|-------------| | ready | Fired when the embed iframe is ready | | authenticated | Fired when authentication is successful | | error | Fired when token exchange fails | | tokenExpiring | Fired when token is about to expire (SDK handles refresh automatically) | | backdropVisible | Fired when a modal/drawer opens in NEO | | backdropHidden | Fired when a modal/drawer closes in NEO |

Methods

sdk.init()

Initializes the SDK and starts the authentication flow.

sdk.getIframe()

Returns the iframe element.

sdk.destroy(removeIframe?: boolean)

Cleans up event listeners. Pass true (default) to also remove auto-created iframe.

Backend Requirements

Your backend must implement:

  1. JWKS endpoint at /.well-known/jwks.json exposing your public key
  2. Mint endpoint (e.g., POST /mint) that returns a signed JWT with claims:
{
  "iss": "https://your-issuer.com",
  "aud": "acme.neohr.io",
  "sub": "user-internal-id",
  "iat": 1756292417,
  "exp": 1756292447,
  "jti": "unique-uuid",
  "email": "[email protected]",
  "first_name": "John",
  "last_name": "Doe",
  "role": "admin"
}

License

MIT