Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spruceid/ssx-server

Package Overview
Dependencies
Maintainers
8
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spruceid/ssx-server

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

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18
increased by500%
Maintainers
8
Weekly downloads
 
Created
Source

ssx-server

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

Full documentation for the SSX-Server SDK can be found at docs.ssx.id.

Quickstart

You can add SSX to your server from npm:

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

Note: Looking for SSX support for other servers besides Express? Check out Configuring SSX on other Servers.

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

import express from 'express';
import { SSXServer, SSXExpressMiddleware } from '@spruceid/ssx-server';

const ssx = new SSXServer({
  signingKey: process.env.SSX_SIGNING_KEY,
  provider: {
    rpc: {
      service: 'infura',
      network: 'homestead',
      apiKey: process.env.INFURA_API_KEY ?? '',
    },
    metrics: {
      service: 'ssx',
      apiKey: process.env.SSX_API_TOKEN ?? '',
    },
  },
});

const app = express();

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

FAQs

Package last updated on 08 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc