Installation
- Runtime
- Node.js 18+
- Output
- CJS + ESM
- Types
- Strict TS
Modern baseline
Dual package
Declarations included
Install package
npm install vibegram| Feature | Support | CJS | ESM | Node | Notes |
|---|---|---|---|---|---|
| Runtime | Node.js 18+ | yes | yes | 18, 20, 22 | Matches package engines. |
| Module output | Dual package | dist/cjs | dist/esm | 18+ | Types are emitted under dist/types. |
| Docs deployment | Static | - | - | 18+ | Safe for GitHub Pages. |
Keep secrets outside the repository
Install the package in your application project, then read bot tokens from environment variables. Never commit `.env` files or real Telegram tokens.
Requirements
- Node.js v18.0 or later
- npm or yarn package manager
Install
bash
npm install vibegramTypeScript Setup
VibeGram is written in TypeScript and ships with built-in type declarations. No additional @types packages are required.
json
// tsconfig.json (recommended settings)
{
"compilerOptions": {
"target": "ES2022",
"module": "CommonJS",
"strict": true,
"esModuleInterop": true
}
}Project Structure
A typical VibeGram project:
my-bot/
├── src/
│ ├── index.ts # Bot entry point
│ ├── commands/ # Command handlers
│ └── scenes/ # Scene definitions
├── package.json
└── tsconfig.jsonVerify Installation
typescript
import { Bot } from 'vibegram';
const bot = new Bot('YOUR_BOT_TOKEN');
bot.command('ping', ctx => ctx.reply('pong'));
bot.launch().then(() => console.log('Bot is running'));Run with:
bash
npx ts-node src/index.ts