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

frick-sierra

v1.2.3

Published

Sierra API Interface

Readme

Sierra API Client

Testing from the command line

Before you start

Install the dependencies

Once you cloned this repo run

npm i

This command will install the needed libraries.

Configuration

Copy config.tpl.yaml into config.yml. Fill in token and password as username and password

Testing a request

Use the request.yml to test making requests for a list of bibrecords and getting back a spreadsheet with the values.

You should be able to run npm start and have the cli run the request and download the information.

As a library

Authentication flow

Authentication can be a one shot authentication or can be setup to automatically update the inner API client with a new token every time the expiration of the token is hit.

In both cases we start by getting a reference to the ApiClient intance:

const { ApiClient } = require('frick-sierra');

We use now this detail to initialize the API Authentication:

const { SierraAuthentication } = require('frick-sierra');
const auth = new SierraAuthentication(ApiClient.instance, '<the base URL for the Sierra API>');

With one shot authentication we need only to call the authentication method:

await auth.authenticate('username', 'password');

The inner ApiClient is now authorized and will be able to make API calls.

Since the tokens will expire - by default every 3600 seconds from issue, we can setup the authentication to renew the token and update the ApiClient when the tokens expire:

auth.startAutoAuth();

This will renew the tokens 300 seconds before they expire automatically. You can change the tolerance to another value when you create the SierraAuthentication instance. For example, to renew the tokens 30 seconds before they expire you can create the instance like this:

const auth = new SierraAuthentication(ApiClient.instance, '<the base URL for the Sierra API>', 30);

When you are done and you want to stop the automatic authentication updates:

auth.stopAutoAuth();

Generate the API Client from scratch

export GENERATOR='https://generator.swagger.io/api/gen/clients/javascript'
export DOCS='https://arcade.nyarc.org/iii/sierra-api/docs'
curl -X POST -H "content-type:application/json" -d "{\"swaggerUrl\": \"${DOCS}\"}" ${GENERATOR}

The generator will return a JSON object:

{
    "code":"xxxxxxx",
    "link":"xxxxxxx"
}

The link property is a link to a ZIP file containing the client. You can now fetch the client.

wget -q -O api-client.zip https://generator.swagger.io/api/gen/download/<id>

Unzip api-client.zip in the root of this project and it will create the javascript-client folder.

Patch the generated Sierra client:

(cd javascript-client && patch -p1 < ../utils/api-client.patch)

Run:

npm i