ssxserver

Home > @spruceid/ssx-serverless > SSXServer

SSXServer class

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 to add authentication and metrics to your server.

Signature:

export declare class SSXServer 

Constructors

Constructor
Modifiers
Description

Constructs a new instance of the SSXServer class

Properties

Property
Modifiers
Type
Description

() => string

Generates a nonce for use in the SSX client libraries. Nonce is a random string that is used to prevent replay attacks. Wraps the generateNonce function from the SIWE library.

(getNonceOpts?: { sessionKey?: any; generateUpdateValue?: (nonce: string) => any; generateCreateValue?: (nonce: string) => any; createOpts?: Record<string, any>; updateOpts?: Record<string, any>; }) => Promise<{ nonce: string; dbResult: any; }>

Generates a nonce and stores it in the current session if a sessionKey is provided or creates a new one if not.

Registers a new event to the API.

Returns the SSXSessionData if a the session still exists and is valid.

ethers.providers.BaseProvider

EthersJS provider.

ENS data supported by SSX.

Definition of CRUD functions for sessions.

Verifies the SIWE message, signature, and nonce for a sign-in request. If the message is verified, a session token is generated and returned.

<T>(sessionKey: any, deleteOpts?: Record<string, any>) => Promise<T>

Calls the delete function to delete the user's session.

Last updated