Links

SSX Server API Reference

ssx-server package

Classes

Class
Description
SSXServer
SSX-Server is a server-side library made to work with the SSX client libraries. SSX-Server is the base class that takes in a configuration object and works with various middleware libraries to add authentication and metrics to your server.

Enumerations

Enumeration
Description
Enum of supported networks for Alchemy
Enum of supported networks for Ankr
Enum of supported networks for Etherscan
Available SSX Log Types
Enum of supported networks for Infura
Enum of supported networks for Pocket
Enum of supported RPC providers

Interfaces

Interface
Description
Configuration interface for cookies issued by ssx-server
Allowed fields for an SSX Log
SSX web3 configuration settings
Configuration interface for ssx-server
SSX Session Store configuration settings

Variables

Variable
Description
This middleware function can be used to protect an Express route with SSX authentication. It will check for ssx.verified and if it is set, the route will be allowed to proceed. If it is not set, the route will redirect or return a 401 Unauthorized response, based on the value of the redirect property.
This middleware function has two key functions: 1. It provides 3 endpoints for the client to hit: /ssx-nonce, /ssx-login, and /ssx-logout. These endpoints are used to authenticate the SIWE message and issue sessions. 2. It provides a middleware function that can be used to authenticate session. The middleware then exposes the authenticated session's data via the req.ssx property.
This middleware function does the following: 1. Checks for a ssx-session cookie and if it exists, it will manage and set the session on the request object. 2. Adds a ssx field to the request object with SSX authentication information in the object. 3. It adds a nonce, login, and logout route to the server
This function returns another function that can take an event listen as a parameter and calls it with the updated request object if none of the ssx routes are hit.

Type Aliases

Type Alias
Description
Alchemy provider settings
Ankr provider settings
Cloudflare provider settings
Custom provider settings
Etherscan provider settings
SSX Express Session Store Provider settings
Generic provider settings
Infura provider settings
Infura provider project settings
SSX Metrics Provider settings
Pocket provider settings
SSX Redis Session Store Provider settings