@grammyjs/storage-cloudflare
v2.6.0
Published
Cloudflare Workers session storage for grammY.
Downloads
3,502
Readme
Cloudflare KV/D1 storages for grammY
Storage adapter that can be used to store your session data in cloudflare when using sessions.
Installation
npm install @grammyjs/storage-cloudflare --saveUsage
D1
You should create table for sessions in your D1 database. You can use the following SQL query and replace sessions with your desired table name:
CREATE TABLE IF NOT EXISTS "GrammySessions" (key TEXT PRIMARY KEY, value TEXT)
CREATE INDEX IF NOT EXISTS "IDX_sessions" ON "GrammySessions" (key)You can check examples folder
