Quickstart

Get from zero to your first subscription check in 5 minutes.

Prerequisites

You need a Stripe account. If you do not have one, create one at stripe.com before starting.

Step 1: Create a Slootly Account

Sign up at app.slootly.dev. Connect your Stripe account via the OAuth flow. Slootly uses Stripe Connect Standard, which means payments go directly to your Stripe account. Slootly never holds your funds.

Step 2: Create a Project and Plans

In the Slootly dashboard, create a new Project (e.g., “StockBot Pro”). Then define your subscription plans:

PlanSlugPrice
Freefree$0/mo
Propro$9.99/mo
Enterpriseenterprise$49.99/mo

Copy your project API key from the dashboard. It starts with sk_test_ for development or sk_live_ for production.

Step 3: Install the SDK

npm install @slootly/sdk

Step 4: Add Slootly to Your Bot

import { Slootly } from '@slootly/sdk';
import TelegramBot from 'node-telegram-bot-api';

const gate = new Slootly('sk_test_your_api_key');
const bot = new TelegramBot(process.env.BOT_TOKEN, { polling: true });

bot.on('message', async (msg) => {
  const userId = msg.from.id.toString();
  const chatId = msg.chat.id;

  // Check subscription status
  const sub = await gate.check(userId, 'telegram');

  if (sub.active && sub.plan === 'pro') {
    // User is subscribed to Pro -- unlock premium features
    bot.sendMessage(chatId, 'Welcome, Pro user! Here is your premium content.');
  } else {
    // User is not subscribed -- send checkout link
    const url = gate.checkoutUrl(userId, 'pro', 'telegram');
    bot.sendMessage(chatId, `Upgrade to Pro for unlimited access: ${url}`);
  }
});

Step 5: Test It

Run your bot locally using a test API key (sk_test_...). Send a message to your bot and you should see:

  1. The bot checks your subscription status (returns inactive for new users)
  2. The bot sends a checkout URL
  3. Open the URL and complete a test payment using Stripe test cards
  4. Send another message -- the bot now recognizes you as a Pro subscriber

Stripe test cards

Use card number 4242 4242 4242 4242 with any future expiry and any CVC for successful test payments.

Next Steps