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

@spruceid/sprucekit-server

v0.1.0

Published

SpruceKit Server is a server-side library made to work with the SpruceKit client libraries. sprucekit-server provides authentication and session management, which can be enabled via an ExpressJS middleware or using the methods provided on the SpruceKitSer

Downloads

7

Readme

SpruceKit Server

SpruceKit Server is a server-side library made to work with the SpruceKit client libraries. sprucekit-server provides authentication and session management, which can be enabled via an ExpressJS middleware or using the methods provided on the SpruceKitServer class.

Documentation

For full documentation, see the SpruceKit Docs

Quickstart

You can add sprucekit-server to your server from npm:

yarn add @spruceid/sprucekit-server
# or
npm install @spruceid/sprucekit-server
# or
pnpm add @spruceid/sprucekit-server

On your server, you'll need to create an instance of sprucekit-server and pass it to an Express middleware layer, as seen below. sprucekit-server doesn't require configuration parameters to use, however it's recommended to have the following variables set:

import express from 'express';
import { SpruceKitServer, SpruceKitExpressMiddleware } from '@spruceid/sprucekit-server';

const sk = new SpruceKitServer({
  signingKey: process.env.SPRUCE_KIT_SIGNING_KEY,
  provider: {
    rpc: {
      service: 'infura',
      network: 'homestead',
      apiKey: process.env.INFURA_API_KEY ?? '',
    },
    metrics: {
      service: 'sk',
      apiKey: process.env.SPRUCEKIT_API_TOKEN ?? '',
    },
  },
});

const app = express();

app.use(SpruceKitExpressMiddleware(sk));
app.listen(3001, () => {
  console.log(`⚡️[server]: Server is running at http://localhost:${3001}`);
});