@tungthedev/streams-server
v0.2.2
Published
Bun-only self-hosted Prisma Streams server.
Downloads
602
Readme
@tungthedev/streams-server
This package contains the Bun-only self-hosted Prisma Streams server.
What It Is
@tungthedev/streams-server is the full Prisma Streams runtime: SQLite and
Postgres WAL/control-plane storage, segmenting, upload support, indexing,
recovery, metrics, and the live / touch system.
It is intended for Bun-based self-hosted deployment. For trusted local
development embedding, use @tungthedev/streams-local instead.
Running It
Recommended:
bunx --package @tungthedev/streams-server prisma-streams-server --object-store local --no-authAfter installation in a project:
bun x prisma-streams-server --object-store local --no-authPrisma Compute
Create a small Compute app that depends on this package and uses the package Compute entrypoint instead of this repository:
process.argv.push("--auth-strategy", "api-key");
await import("@tungthedev/streams-server/compute");The package Compute entrypoint injects --object-store r2, and injects
--auto-tune when DS_MEMORY_LIMIT_MB is set. It does not inject auth; pass
--auth-strategy api-key as shown above, and set API_KEY in the Compute
environment.
Useful environment variables:
PORTDS_HOSTDS_HTTP_IDLE_TIMEOUT_SECONDSAPI_KEYwhen using--auth-strategy api-key
For R2 or S3-compatible object storage set:
DURABLE_STREAMS_R2_BUCKETDURABLE_STREAMS_R2_ACCOUNT_IDfor Cloudflare R2, orDURABLE_STREAMS_R2_ENDPOINTfor S3-compatible object storesDURABLE_STREAMS_R2_ACCESS_KEY_IDandDURABLE_STREAMS_R2_SECRET_ACCESS_KEY, unless using the AWS default credential provider chain
Static credentials take precedence when set. DURABLE_STREAMS_R2_SESSION_TOKEN
is optional for temporary static credentials. If static credentials are omitted,
the server uses the AWS default credential provider chain.
See ../docs/overview.md and ../docs/conformance.md in the repository for the full runtime documentation.
