ssxserver
Home > @spruceid/ssx-server > 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 and works with various middleware libraries to add authentication and metrics to your server.
Signature:
Extends: EventEmitter
Constructors
Properties
() => 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.
() => SessionOptions
Gets Express Session config params to configure the session.
(siwe: Partial<SiweMessage> | string, signature: string, daoLogin: boolean, resolveEns: boolean | SSXEnsResolveOptions, nonce: string) => Promise<{ success: boolean; error: SiweError; session: Partial<SessionData>; }>
Verifies the SIWE message, signature, and nonce for a sign-in request. If the message is verified, a session token is generated and returned.
(destroySession?: () => Promise<any>) => Promise<boolean>
Logs out the user by deleting the session. Currently this is a no-op.
(address: string, resolveEnsOpts?: SSXEnsResolveOptions) => Promise<SSXEnsData>
ENS data supported by SSX.
Last updated