Skip to main content
Version: SDK V4 (latest)

Custom Session Storage Tutorial

Use Custom storage for session keys module with Node JS

📄️ Introduction

The session storage module provides a way to create sessions for an App, where users can make use of the session for signing purpose. These session keys are stored on chain, and information for each leaf is stored in offchain data storage. By default it gets stored in the browser local storage. This tutorial covers how one can create a custom Session storage for their Dapps. It can be a database or file. In this we will go over the implementation of the File storage for their session leaf.

📄️ Session Module

As described in the last section, an off-chain storage solution is essential for the session leafs. In this context, we will employ Files for storing this data. Any customized storage layer must adhere to a specific interface, ensuring the correct implementation of methods for saving or retrieving information. Alternatively, one can develop their own implementation using a Database server layer. This guide will lead you through the process of creating a fundamental Node.js script using TypeScript that enables users to initiate a session..