npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@qumra/app-session-storage-prisma

v1.0.2

Published

Prisma-based session storage adapter for Qumra apps — supports PostgreSQL, MySQL, SQLite, and more

Downloads

305

Readme

@qumra/app-session-storage-prisma

npm version License: ISC

Prisma-based session storage for Qumra apps — supports PostgreSQL, MySQL, SQLite, and more.

Installation

npm install @qumra/app-session-storage-prisma @qumra/app-sdk

Requires @prisma/client >=5.0.0 as a peer dependency:

npm install -D @prisma/client

Prisma Schema Setup

Add a Session model to your Prisma schema:

model Session {
  id        String    @id @default(cuid())
  store     String    @db.VarChar(255)
  userId    String?   @db.VarChar(255)
  data      Json?
  expiresAt DateTime?
  createdAt DateTime  @default(now())
  updatedAt DateTime  @updatedAt

  @@index([store])
  @@index([expiresAt])
}

Run migrations to apply the schema:

npx prisma migrate dev --name init

Usage with qumraApp

Initialize the session storage adapter:

import { qumraApp } from '@qumra/app-sdk';
import { PrismaSessionStorage } from '@qumra/app-session-storage-prisma';
import { PrismaClient } from '@prisma/client';

const prisma = new PrismaClient();
const sessionStorage = new PrismaSessionStorage(prisma);

const app = qumraApp({
  sessionStorage,
  // ... other config
});

API Reference

storeSession(store, session)

Stores or updates a session in the database.

await sessionStorage.storeSession('my-store', {
  id: 'session-123',
  userId: 'user-456',
  data: { preferences: { theme: 'dark' } },
  expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000),
});

loadSession(store, id)

Retrieves a session by store and ID. Returns null if not found or expired.

const session = await sessionStorage.loadSession('my-store', 'session-123');

deleteSession(store, id)

Deletes a single session.

await sessionStorage.deleteSession('my-store', 'session-123');

deleteSessions(store, ids)

Deletes multiple sessions in a single operation.

await sessionStorage.deleteSessions('my-store', ['session-123', 'session-456']);

findSessionsByStore(store, options?)

Finds all sessions for a given store with optional filtering.

const sessions = await sessionStorage.findSessionsByStore('my-store', {
  userId: 'user-456',
  limit: 10,
  offset: 0,
});

Session Interface

Sessions conform to the following interface:

interface Session {
  id: string;
  store: string;
  userId?: string;
  data?: Record<string, any>;
  expiresAt?: Date;
  createdAt: Date;
  updatedAt: Date;
}
  • id: Unique session identifier
  • store: Logical store/namespace identifier
  • userId: Optional user association
  • data: Arbitrary session metadata
  • expiresAt: Optional expiration timestamp
  • createdAt: Session creation time
  • updatedAt: Last modification time

Qumra Ecosystem

| Package | Description | |---|---| | @qumra/app-sdk | Core SDK — sessions, security, errors | | @qumra/app-react-router | React Router 7 integration | | @qumra/app-session-storage-prisma | Prisma session storage | | @qumra/app-session-storage-mongodb | MongoDB session storage | | @qumra/jisr | App Bridge — Admin communication | | @qumra/manara | Design system & components | | @qumra/riwaq | UI Extensions SDK |

License

ISC © Qumra