@spruceid/ssx-serverless
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

"SSX Header"

SSX Serverless

ssx-serverless is a serverless version of ssx-server. It's intended to make it easier to be used in this kind of architecture.

Installing

npm install --save @spruceid/ssx-serverless
# OR
yarn add @spruceid/ssx-serverless

Building

npm run build
# OR
yarn build

Usage

The library exports a main class SSXServer which is supposed to be used as a Singleton. A basic configuration for this class would look like the following:

import { 
  SSXServer,
  SSXRPCProviders,
  SSXInfuraProviderNetworks,
} from '@spruceid/ssx-serverless';

const _create = async <T>(value: any, opts?: Record<string, any>): Promise<T> => {
    return dynamoDb.put(value).promise() as T;
};

const ssx = new SSXServer({
  providers: {
    rpc: {
      service: SSXRPCProviders.SSXInfuraProvider,
      apiKey: process.env.INFURA_ID,
      network: SSXInfuraProviderNetworks.GOERLI,
    }
  }
}, {
    create: _create,
    retrieve: _retrieve,
    update: _update,
    delete: _delete,
});

For more information see the example.

/@spruceid/ssx-serverless/

    Package Sidebar

    Install

    npm i @spruceid/ssx-serverless

    Weekly Downloads

    8

    Version

    1.2.3

    License

    Apache-2.0 OR MIT

    Unpacked Size

    192 kB

    Total Files

    20

    Last publish

    Collaborators

    • obstropolos
    • jszersze
    • skgbafa
    • chunningham
    • wycjs
    • sbihel
    • w4ll3
    • xtheosirian