Installation
StreamPot consist of two parts:
@streampot/clientis a JavaScript library that you can use to interact with the server.@streampot/serveris a CLI tool that you can use to launch the server.
Setting up the client
sh
$ npm add -D @streampot/clientsh
$ pnpm add -D @streampot/clientsh
$ yarn add -D @streampot/clientjs
import StreamPot from '@streampot/client';
const client = new StreamPot({
secret: 'your-api-key',
baseUrl: 'http://localhost:3000',
});For examples on how to use the client, visit the examples page.
Setting up the server (without Docker)
TIP
Instead, you might want to use our Docker Compose template to get started in no time.
Prerequisites
- Node.js version 20 or higher.
- PostgreSQL
- Redis
- FFmpeg
Installation
sh
$ npm add -g @streampot/serversh
$ pnpm add -g @streampot/serversh
$ yarn global add @streampot/serverStarting the server
Create a new .env file:
shell
DATABASE_URL=postgres://postgres:example@db:5432/example
REDIS_URL=redis://redis:6379
S3_ACCESS_KEY=
S3_SECRET_KEY=
S3_REGION=
S3_BUCKET_NAME=
S3_ENDPOINT=
S3_PUBLIC_DOMAIN=WARNING
Due to the risks involved in processing user-provided content with ffmpeg encoders, it is recommended that ffmpeg is run by spinning up on-demand Docker containers.
To enable this, add the following to your .env file:
shell
FFMPEG_STRATEGY=dockerAnd pull the ffmpeg image on the system:
shell
docker pull linuxserver/ffmpegBefore starting the server, run this command to set-up the database tables:
sh
$ streampot migrateNow you can start the server:
sh
$ streampot serve --port=3000