VidTube runs on Node.js and MongoDB. This guide walks you through setting up a local instance and making your first real API calls — from a healthcheck all the way to fetching your profile with a bearer token. If you just want to explore endpoints without any setup, skip straight to the live demo.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Pragyat-Nikunj/VidTube/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Node.js v14 or later
- MongoDB — a local instance or a connection string from MongoDB Atlas
- npm or yarn
Set up a local instance
Create your environment file
Copy the template below into a
.env file in the project root. See Environment variables for a description of every value.CLOUDINARY_* values are required for video and avatar uploads. Create a free account at cloudinary.com to get them. See Cloudinary setup for details.Use the live demo
You can test the public API without running anything locally. All examples below use the hosted base URL:Make your first API calls
1. Healthcheck
Verify the API is up before making other requests.2. List videos
Fetch all published videos — no authentication required.3. Register a user
Registration requiresmultipart/form-data because you upload an avatar image alongside the text fields. avatar is required; coverImage is optional.
201 and the new user object (password and refresh token are excluded).
4. Log in
Sendemail, username, and password as JSON. The response contains both accessToken and refreshToken in the body and as httpOnly cookies.
accessToken value — you need it for protected endpoints.
5. Call a protected endpoint
Pass the access token as aBearer token in the Authorization header.
Next steps
Authentication
Learn how to refresh tokens, handle expiry, and log out cleanly.
Video uploads
Upload videos and thumbnails, and toggle publish status.
Social interactions
Add likes, comments, tweets, and manage subscriptions.
Channel dashboard
Pull channel stats: views, subscribers, video count, and likes.