Skip to content

Find a component

Loading the directory…

↑ ↓ to select · Enter to open · Esc to closeBrowse all →
Contributor login

Hosting

Static files and server-rendered pages from your backend's Convex deployment. Files follow Cloudflare Workers rules. TanStack Start adapter available.

Upstream source
git clone https://github.com/samebase/convex-hosting.git
cd convex-hosting

This upstream package has not been adapted or qualified for Bijection. Read the original documentation before adopting it.

Description

Static files and server-rendered pages from your backend's Convex deployment. Files follow Cloudflare Workers rules. TanStack Start adapter available.

Explore the package README for API concepts, configuration, and examples. Check the Bijection source for adaptation-specific setup.

Available to evaluate

Review the source and its dependencies before adopting this package. Source availability does not establish npm publication or runtime qualification.

Getting started

  1. Get the source at the revision above and read its package documentation.
  2. Check the required Bijection SDK version, dependencies, and external service credentials.
  3. Follow the package setup instructions and the guide to using components.
  4. Exercise the component in your deployment according to your project’s verification rules.

Open source

Maintained source: samebase/convex-hosting. License: See repository. Consult the repository for license terms, notices, and contributor attribution.

From the upstream publisher

Serves a web app from its own Convex deployment: the files of a build, and the pages the app renders.

Explore the demo ↗

Upstream package FAQ

How is convex-hosting different from Convex's built-in static-hosting component?

Convex's static-hosting component serves files only. convex-hosting (@samebase/convex-hosting) adds server-rendered pages through a fetch handler, uses Cloudflare's asset Worker serving rules (_headers, _redirects, html_handling, not_found_handling), and provides a TanStack Start adapter. A migration guide is available in the repository at docs/from-static-hosting.md.

What are the requirements to use convex-hosting?

convex-hosting requires Node 22 or later and the convex package at version 1.46 or later. Install it with npm install @samebase/convex-hosting, then mount the component in convex/convex.config.ts and register routes in convex/http.ts using routeAll.

How does convex-hosting handle the initial dev setup on a fresh clone?

On a fresh clone, convex/http.ts imports .convex-hosting/version.js, which is only written by a deploy. The first npx convex dev will error on that missing file. Run npx convex dev in one terminal to create the deployment, then run npx convex-hosting deploy --dev in a second terminal. The deploy writes the version file and pushes; after that, the watcher in the first terminal resumes normal operation.

What tradeoffs exist compared to deploying on an actual Cloudflare Worker?

A Cloudflare Worker runs at the data center nearest the visitor, has access to Node's built-in modules, an edge cache, and WebSockets. convex-hosting runs inside a Convex HTTP action and does not provide these capabilities. The repository documents the full list with specifics at docs/workers.md, and a Worker twin of the TanStack Start example is deployed side by side so the difference can be observed.

Can convex-hosting be used in CI with deploy keys?

Yes. The convex-hosting deploy command supports deploy keys and CI usage. The repository documents previews, deploy keys, and CI configuration at docs/deploy.md. The one constraint is that only one deploy should run at a time per deployment, as documented in the design notes.

Use with agents and CLI

Give your coding agent the component’s source identity and setup guidance.

agent-prompt.md
Help me integrate Hosting with Bijection.

Read: https://bijection.com/components/samebase-convex-hosting/SKILL.md

Check SDK compatibility and dependency availability.
Follow this project's execution and verification rules.

Read upstream package documentation ↗

Keywords