
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@pake/baileys-store
Advanced tools
Minimal Baileys data storage for your favorite DBMS built with Prisma
Minimal Baileys data storage for your favorite DBMS built with Prisma. This library is a simple handler for Baileys event emitter that will listen and update your data in the database
model Session {
pkId BigInt @id @default(autoincrement())
sessionId String
id String
- data String @db.Text
+ data String
@@unique([sessionId, id], map: "unique_id_per_session_id_session")
@@index([sessionId])
}
pkId field. Then follow the previous CockroachDB guideJSON scalar type# Using npm
npm i @pake/baileys-store
# Using yarn
yarn add @pake/baileys-store
Before you can actually use this library, you have to setup your database first
.env.example file from this repository or from the node_modules directory (should be located at node_modules/@pake/baileys-store/.env.example). Rename it into .env and then update your connection url in the DATABASE_URL fieldprisma directory from this repository or from the node_modules directory (should be located at node_modules/@pake/baileys-store/prisma/). Additionaly, you may want to update your provider in the schema.prisma file if you're not using MySQL databaseimport pino from 'pino';
import makeWASocket from '@whiskeysockets/baileys';
import { PrismaClient } from '@prisma/client';
import { initStore, Store } from '@pake/baileys-store';
const logger = pino();
const socket = makeWASocket();
const prisma = new PrismaClient();
// You only need to run this once
initStore({
prisma, // Prisma client instance
logger, // Pino logger (Optional)
});
// Create a store and start listening to the events
const store = new Store('unique-session-id-here', socket.ev);
// That's it, you can now query from the prisma client without having to worry about handling the events
const messages = prisma.message.findMany();
PRs, issues, suggestions, etc are welcome. Please kindly open a new issue to discuss it
FAQs
Minimal Baileys data storage for your favorite DBMS built with Prisma
We found that @pake/baileys-store demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.