constructor

Home > @spruceid/ssx-serverless > SSXServer > (constructor)

SSXServer.(constructor)

Constructs a new instance of the SSXServer class

Signature:

constructor(config: SSXServerConfig, session: SSXSessionCRUDConfig);

Parameters

ParameterTypeDescription

config

Base configuration of the SSXServer.

session

CRUD definition for session operations.

Example

const ssx = new SSXServer({
  providers: {
    rpc: {
      service: SSXRPCProviders.SSXInfuraProvider,
      apiKey: process.env.INFURA_ID,
      network: SSXInfuraProviderNetworks.GOERLI,
    }
  }
}, {
    create: async <T>(value: any, opts?: Record<string, any>): Promise<T> => { },
    retrieve: async <T>(key: any, opts?: Record<string, any>): Promise<T> => { },
    update: async <T>(key: any, value: any, opts?: Record<string, any>): Promise<T> => { },
    delete: async <T>(key: any): Promise<T> => { },
});

Last updated