docs: remove free tier, update rate limits and auth for demo+pro model
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 11m58s
Promote to Production / Deploy to Production (push) Successful in 2m21s

- Remove free tier from rate limits, add Demo (5/hour, watermarked)
- Update auth section: remove free-tier key mention, link to docfast.dev
- Update getting started: demo → upgrade to Pro → use API key
- Add deprecated: true to /v1/signup/free swagger annotation
- Regenerate openapi.json
This commit is contained in:
DocFast Bot 2026-02-20 19:10:25 +00:00
parent c35ff2bc97
commit 45b5be248c
8 changed files with 1118 additions and 11 deletions

View file

@ -1,7 +1,7 @@
import { Router } from "express";
import rateLimit from "express-rate-limit";
import Stripe from "stripe";
import { createProKey, downgradeByCustomer, updateEmailByCustomer } from "../services/keys.js";
import { createProKey, downgradeByCustomer, updateEmailByCustomer, findKeyByCustomerId } from "../services/keys.js";
import logger from "../services/logger.js";
function escapeHtml(s) {
return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
@ -123,6 +123,27 @@ router.get("/success", async (req, res) => {
res.status(400).json({ error: "No customer found" });
return;
}
// Check DB for existing key (survives pod restarts, unlike provisionedSessions Set)
const existingKey = await findKeyByCustomerId(customerId);
if (existingKey) {
provisionedSessions.add(session.id);
res.send(`<!DOCTYPE html>
<html><head><title>DocFast Pro Key Already Provisioned</title>
<style>
body { font-family: system-ui; background: #0a0a0a; color: #e8e8e8; display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; }
.card { background: #141414; border: 1px solid #222; border-radius: 16px; padding: 48px; max-width: 500px; text-align: center; }
h1 { color: #4f9; margin-bottom: 8px; }
p { color: #888; line-height: 1.6; }
a { color: #4f9; }
</style></head><body>
<div class="card">
<h1> Key Already Provisioned</h1>
<p>A Pro API key has already been created for this purchase.</p>
<p>If you lost your key, use the <a href="/docs#key-recovery">key recovery feature</a>.</p>
<p><a href="/docs">View API docs </a></p>
</div></body></html>`);
return;
}
const keyInfo = await createProKey(email, customerId);
provisionedSessions.add(session.id);
// Return a nice HTML page instead of raw JSON