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

@grammyjs/storage-pocketbase

v2.5.0

Published

Pocketbase storage adapter for grammY

Downloads

7

Readme

Pocketbase storage adapter for grammY

Storage adapter that can be used to store your session data with Pocketbase when using sessions.

Usage

Host a Pocketbase instance

This package was developed with Pocketbase v0.22.7 in mind, you may upgrade or downgrade your Pocketbase instance version, but full compatibility is not guaranteed

Pocketbase v0.22.7 binaries

This package uses the Pocketbase instance URL; You may obtain this after running ./pocketbase serve in the terminal, in the location that you have extracted your pocketbase binary.

For more information regarding this, read the official Pocketbase documentation.

In this example and for ease of prototyping, we will host a Pocketbase instance on our local Windows machine.

After running ./pocketbase serve in the location in which we extracted the .exe binary, we will be faced with this screen:

Pocketbase server routes

Copy the underlined url, this url will be used for the pocketbaseInstanceUrl when using this storage adapter

Open the Admin UI page in your browser, if it's the first time that you are instantiating your Pocketbase instance, go ahead and create your root admin user.

Then from the left sidebar, click on the settings icon and then "Import collections", and paste this configuration:

Make sure to place your Telegram bot token inside the "your telegram bot token" fields

[
    {
        "id": "sxeo80n9r1j23md",
        "name": "sessions",
        "type": "base",
        "system": false,
        "schema": [
            {
                "system": false,
                "id": "rr9dbgn5",
                "name": "key",
                "type": "text",
                "required": false,
                "presentable": false,
                "unique": false,
                "options": {
                    "min": null,
                    "max": null,
                    "pattern": ""
                }
            },
            {
                "system": false,
                "id": "o1epnmt2",
                "name": "value",
                "type": "json",
                "required": false,
                "presentable": false,
                "unique": false,
                "options": {
                    "maxSize": 2000000
                }
            }
        ],
        "indexes": [],
        "listRule": "@request.headers.bot_token = \"your telegram bot token"",
        "viewRule": "@request.headers.bot_token = \"your telegram bot token"",
        "createRule": "@request.headers.bot_token = \"your telegram bot token"",
        "updateRule": "@request.headers.bot_token = \"your telegram bot token"",
        "deleteRule": "@request.headers.bot_token = \"your telegram bot token"",
        "options": {}
    }
]

After doing this, there's not much to do with the Pocketbase instance anymore; You may configure your fields, indexes etc... if you are aware of the repercussions

Use the package in your grammY code

Refer to Node example