StreamGate is a self-hosted video sharing web app built with Next.js and powered by FastPix. It lets users upload videos or record their screen and camera in the browser, then share a permanent link within seconds. No database is required.
Live demo: streamgate.dev
StreamGate implements a complete video upload and playback workflow using FastPix APIs. Key capabilities include:
FastPix APIs use HTTP Basic Auth. Your Access Token ID is the username; your Secret Key is the password.
To generate credentials:
For detailed steps, see Authentication with Basic Auth.
Create a .env.local file in the project root:
Add the following variables:
WARNING:
Never commit
.env.localto version control. The file is already listed in.gitignore.
For a full description of each variable, see Environment variables reference.
Open http://localhost:3000 in your browser.
You don’t need to run StreamGate as a standalone project. You can copy individual parts into your own codebase.
Copy the following files into your Next.js project for server-side FastPix integration:
Install the FastPix Node SDK:
Then call the routes from your existing frontend:
Copy these ready-made components into your Next.js or React project:
<Uploader /> — drag-and-drop file upload with a progress bar:
<Player /> — FastPix HLS player web component:
<Recorder /> — in-browser screen and camera recorder:
Install the required dependencies:
For non-Next.js backends, use the FastPix Node SDK without any of the StreamGate files:
For the full SDK reference, see the FastPix API reference.
StreamGate verifies incoming FastPix webhook payloads using HMAC-SHA256. To enable verification, set the FASTPIX_WEBHOOK_SECRET environment variable.
In the FastPix Dashboard, go to Manage → Webhooks and add:
Note: If
FASTPIX_WEBHOOK_SECRETis not set, signature verification is skipped. This is acceptable for local development but not recommended in production.
All API routes return JSON error responses with an error field and an HTTP status code.
Example: handling an upload error
FastPix API errors are logged to the server console with the full status code, response body, and headers.
Cloudflare Pages is the recommended deployment target for StreamGate.
wrangler.tomlIn the project root, create a wrangler.toml file with the following content:
NOTE:
The
nodejs_compatflag is required. StreamGate uses the FastPix SDK and the Node.jscryptomodule for webhook signature verification.
package.jsonNEXT_PUBLIC_BASE_URL to your production domain, for example https://streamgate.pages.dev.