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

@daysmart/sso

v1.1.0

Published

This repo contains the code for `@daysmart/sso`, an npm package for using DaySmart SSO

Downloads

3

Readme

DaySmart SSO npm package

This repo contains the code for @daysmart/sso, an npm package for using DaySmart SSO

Usage

This package exposes two methods:

openPopup(options?: SSOOptions): Promise<SSOResponse> - This method opens a popup window for the user to log in via DaySmart SSO. On valid authenication, it returns a promise containing a status string, a tokens object, and an error message if something failed, and by default saves the tokens into cookies on the current domain. The options parameter can be used to further control behavior.

openIFrame(targetElementId: string, options?: SSOOptions): Promise<SSOResponse> - This method embeds an iframe into the target element that allows the user to login via DaySmart SSO. On valid authenication, it returns a promise containing a status string, a tokens object, and an error message if something failed, and by default saves the tokens into cookies on the current domain. The options parameter can be used to further control behavior.

interface SSOOptions {
    /** Automatically save tokens in both the SSO and client sites.  Default true. */
    saveTokens?: boolean;
    /** Run in temporary mode, which will not read any existing tokens (forcing the user to log in) and will not save the tokens.  Default false. */
    isTemporary?: boolean;
    /** Optionally provide the Url of the SSO page.  A default url will be used if omitted. */
    ssoUrl?: string;
    /** Prompt the user to use existing tokens instead of automatically using them.  Default false. */
    promptForExistingTokens?: boolean;
    /** Force the SSO page to remove any existing tokens automatically.  Default false. */
    removeExistingTokens?: boolean;
}

Development

git pull
npm i

npm run dev - serve testing page and watch for changes

npm run build - build package

npm run test - run unit tests

Publishing

TODO: This should be automated, via a commit message trigger or similar, to update package version and publish

Before publishing, make sure to run npm run build to ensure the latest build artifacts are being committed/published. Then if not already, log into the cli with npm login. Be sure to use credentials that have access to the @daysmart org.

The NPM registry doesn't allow overwriting an existing version of the package, so we need to update the package version following SemVer practices.

Given version scheme MAJOR.MINOR.PATCH:

  • for incompatible API changes, run npm version major
  • for new (but backwards-compatible) functionality, run npm version minor
  • for backwards-compatible bug fixes, run npm version patch

Each of the above npm version commands will automatically create a commit and tag with the new package version. npm publish to publish the built library to NPM. Don't forget to push that new version commit.