Publish my shop with Brainerce hosting

Publish the storefront you built to a brainerce.app address, connect your own domain, publish from GitHub, set environment variables and roll back to an earlier version. Paid plans only, one site per sales channel.

Brainerce hosting publishes the storefront you built and gives it a web address, so you do not need a separate host such as Vercel or Netlify. It publishes any Next.js shop: the one that npx create-brainerce-store creates, an older one made with that tool, or a Next.js shop built another way. A shop that is not a Next.js project (a static site, or a single-page app made with Vite or plain React) cannot be published yet, and there is no date for it. You publish from your computer or from GitHub, you manage the address, variables and earlier versions in the dashboard, and your shop keeps talking to your Brainerce store as before.

Paid plans only. Hosting is part of the paid plans (Pro, Growth and Enterprise). On the Free plan the Hosting tab shows a lock and an upgrade prompt, and you cannot create a site. One hosted site per sales channel. The number of sales channels your plan allows is the number of sites you can host, and Brainerce can also set a different site limit for a store. If you reach it, creating another site says so.

What Brainerce hosting does and does not do

It does:

  • Publishes your storefront to your-name.brainerce.app, and to your own domain if you connect one.
  • Keeps your last ten versions so you can roll back.
  • Stores environment variables and secrets for the site.
  • Publishes from a GitHub repository, if you connect one.

It does not:

  • It does not change your code. It publishes the shop you give it. It does not edit it, redesign it, or fix a build error. If the build fails, the message tells you what to fix in your project, then you publish again.
  • It does not publish a shop that is not a Next.js project. A static site or a single-page app (Vite, plain React) has no way to be published here today, and there is no date for it. The add-hosting command stops on such a folder and changes nothing.
  • It does not promise that every Next.js shop runs. Brainerce hosting runs your shop on Cloudflare Workers, which cannot do a few things (see What hosting needs from a Next.js shop). When the build finds one of them it stops and says what to change. Shop routes that use runtime = 'edge', middleware that uses Node-only features, and the Next.js 16 proxy.ts file have not been tested. We have not yet published a real older shop, or a shop not made with the starter, from start to finish.
  • It does not bill hosting on its own yet, and no monthly request allowance is enforced. The Hosting tab shows how many requests your site served, but that is a trend, not a bill. Brainerce may add allowances later. There are no promises about CPU time or traffic per plan.
  • It does not work on the Free plan. A site on a store that drops to Free is suspended (see What happens when my plan changes).
  • It does not support a payment provider that sends the shopper back to your storefront with a POST request. The shopper returns to a hosted shop with a normal page visit, and the provider's payment notice goes to Brainerce, not to your shop.
  • It does not publish for a team member without the right permission (see Who can publish).

Who can publish my shop (team permissions)

Hosting lives in Sales Channels → your channel → Hosting. You need:

  • View store settings to see the Hosting tab.
  • Manage integrations to create a site, publish, roll back, connect a domain, change variables or delete the site.
  • Manage API keys as well to approve a publish from your computer or to connect a GitHub repository, because both give a short-lived publish key to a tool.

By default the Owner and a Manager have all three. A Staff member has View store settings only, so they can open the Hosting tab but cannot create, publish or change anything. A Viewer has no access to store settings and does not see the tab. Brainerce does not give Staff or Viewer Manage API keys by default, so a publish is approved by an Owner or a Manager. You can change a member's permissions one by one (see Team and permissions). A team member who is limited to some sales channels only sees the site of their own channels.

Only a signed-in person in the dashboard can do this. An API key, the Brainerce AI assistant or an MCP connector cannot create a site, approve a publish or connect a repository. Your AI coding tool can run the publish command for you, but you approve it yourself in the browser.

Publish my shop from the command line (Windows, Mac and Linux)

Paid plan required. Do this in the folder of your Next.js shop (made with create-brainerce-store or another way).

  1. Make sure the shop is connected to your sales channel (see Connect with npx). A shop made earlier, or one not made with create-brainerce-store, needs the publish scripts first: see Publish an older shop or any Next.js shop.

  2. In the dashboard open Sales Channels → your channel → Hosting. Choose the address and press Create the site. (You can also skip this and choose the address on the approval page in step 3.)

  3. In the shop folder run:

    npm run deploy:hosted

    It builds the shop and uploads it. The first time, it prints a link and a short code. Open the link in your browser, check that the code is the same, and approve. The approval gives the command a key that works for one hour, for this one site.

  4. The site goes live and the Hosting tab updates by itself. Next time run the same command, or ask your AI tool to run npm run deploy:hosted. The tool shows you the link and you approve it.

If you would rather build first and upload later, run npm run build:hosted, then npm run deploy:hosted -- --skip-build.

The computer remembers your sign-in so the next publish does not ask again. npm run hosted:logout forgets it.

Publishing from Windows

Windows builds directly. Docker is not needed. A shop made with starter version 1.101.0 or newer builds on Windows, Mac and Linux the same way, with no Docker. On Windows the command prints one line that the build tool (OpenNext) does not officially support Windows. Leave the build to finish. A direct Windows build worked on two real shops, but it is the least tested of the three systems.

If a Windows build fails, you have three options:

  • Build in WSL (Linux inside Windows), then run the command there.
  • Add --docker to build in a Linux container. This needs Docker Desktop running. This path was not proven on a real Windows run.
  • Publish from GitHub instead, see below. GitHub builds the shop on its own side and never uses your computer.

Publish an older shop or any Next.js shop

Run npx create-brainerce-store@latest add-hosting in the shop folder (your developer or your AI tool can run it). It adds the publish scripts and the build tools to a Next.js shop. There is no "too old" refusal any more: it works on a shop made with an older version of the starter and on a Next.js shop that was not made with the starter at all.

  • It looks at the folder first and tells you what it found: a starter shop (and its version) or another Next.js project.
  • It stops in only two cases, and changes nothing: the folder has no package.json, or package.json has no next in it. A static site or a single-page app (Vite, plain React) cannot be published yet, and there is no date for it.
  • It does not change your sign-in code or your cookies.
  • It does not commit anything. Review the changes and commit them yourself.

One thing it can change in your code, and only for a shop made with the starter. A shop that imports isomorphic-dompurify or jsdom on the server shows an error page (500) once it runs on Brainerce hosting, because those packages cannot run there. For a starter shop, add-hosting swaps them for a cleaner that does run there:

  • It replaces a file only when that file is exactly a version the starter once shipped. A file you changed is never overwritten: the new version is written next to it with the ending .brainerce-new, with a note on what to merge.
  • Every file it changes is copied first to .brainerce-backup/<time>/ (kept out of git).
  • Running the command a second time changes nothing.

For a Next.js shop that was not made with the starter, add-hosting never edits your source files. If the shop uses one of those packages on the server, the build stops and tells you the fix (use sanitize-html).

What hosting needs from a Next.js shop

Hosting runs your shop on Cloudflare Workers. npm run build:hosted checks your shop first. Each of these stops the build with one sentence and one fix:

What the build findsWhat to do
The server imports isomorphic-dompurify or jsdomUse sanitize-html instead (for a starter shop, run add-hosting).
The code uses child_processRemove it from the server code. A program cannot be started on Workers.
The code imports sharpRemove the import and use the Next.js image component.
The code writes files to the disk while the shop runsOn a shop made with the starter this stops the build: keep that data in a database or an online service. On another Next.js shop it is only a warning in the log (a seed or sitemap script that runs while the shop builds is fine), but it fails if it runs while the shop is live.
package.json has no build scriptAdd one.
next.config has output: 'export'Remove it. A static export is not supported.

The remote build (Publish now from GitHub) also gives a plain sentence for these: the server code is too large, it is split into too many files, one static file is too large, there are too many static files or they are too large in total, a package with a native add-on (sharp or a .node file), child_process, jsdom or isomorphic-dompurify in the server code, output: 'export', a missing build script, an unsupported Next.js version, npm that cannot resolve the dependencies, a package-lock.json that does not match package.json, a TypeScript error, a pnpm, yarn or bun command that is not installed, and a fetch to a website that is not allowed while the shop builds. Each sentence names one fix.

What is not supported or not tested:

  • Not tested: pages or API routes that use runtime = 'edge', middleware that uses Node-only features, and the Next.js 16 proxy.ts file. They may work or not. Test the published shop before you announce it.
  • Which Next.js version: hosting needs Next 15.5.29 or newer, or Next 16.4.5 or newer. On Next 14, or on an older 15 or 16, the build stops with the sentence "This project uses Next X; hosting needs Next 15.5.29 or newer (or 16.4.5 or newer). Upgrade next and push." Upgrade next in package.json, run npm install, commit package.json and package-lock.json, and publish again.
  • Hosting builds with npm only, not pnpm, yarn or bun. If your shop has only a pnpm-lock.yaml, a yarn.lock or a bun lockfile, Brainerce installs it with npm install, which does not use the versions that lockfile pinned, and the build log says which lockfile it found. A build script that runs pnpm or yarn fails with a sentence saying this project builds with another package manager. Run npm install once on your computer, commit the package-lock.json it creates, and publish again.
  • The build cannot fetch from other websites. While your shop builds, it can reach the npm registry, Google Fonts, your Brainerce store and the storage Brainerce uses, and nothing else. A page that calls a CMS or another API while it builds (for example a static page that fetches its content at build time) stops the build with the sentence "The build tried to reach a website that is not allowed ... Fetch that data at request time instead." There is no setting that allows another website. Make that page fetch its data when a visitor opens it instead.
  • A .npmrc file is used only for install settings. Settings such as legacy-peer-deps=true are kept, so a shop that needs them installs. Passwords, tokens and private package registries in the file are removed, so a private npm registry does not work. .env files are never uploaded either: a .env.production committed to the repository is not read by the build.
  • A build that takes longer than about ten minutes is stopped and says it ran out of time.
  • Only a Next.js project at the top of the repository. A project inside a sub-folder is not supported yet.
  • Hosting does not fix any of this for you. It tells you what to change, you change it, then you publish again.

Publish from GitHub (Connect with GitHub, Publish now, publish on every push)

Open Hosting and find Publish automatically from GitHub. There are two ways to connect a repository, and they do different things.

The repository needs a Next.js project at its top level: a package.json in the root folder. It does not need the publish scripts, and it does not need a package-lock.json. Brainerce builds with its own build steps and never runs the scripts in your repository. A package-lock.json is still recommended: without one, Brainerce installs with npm install, which can pick newer package versions than the ones you tested, and the build log says so. A project inside a sub-folder is not supported yet. (The by-name route below runs a workflow that does use the publish scripts, so run add-hosting --github-actions there.)

Connect with GitHub: Publish now and publish on every push

This button appears only once Brainerce opens its GitHub App to every account. Until you see Connect with GitHub, use the other way below or the command line.

  1. Press Connect with GitHub, sign in to GitHub, and choose the repository from the list of repositories you administer. Nothing to type.
  2. Press Publish now. Brainerce reads the latest commit of the repository's default branch, builds the shop and publishes it. The build took about five minutes in our test.
  3. Publish on every push is on by default. Every push to the default branch publishes the shop by itself. Several pushes in a row are built as one publish of the latest state. You can switch it off at any time and keep using Publish now.

A rollback pauses publish on push. If you roll back, Publish on every push switches itself off and says why, so the next push does not undo your rollback. Turning it back on is your decision.

A repository that is missing from the list has not been added to the Brainerce Hosting GitHub App's installation. Add it in GitHub (the App is installed on selected repositories only), and GitHub may ask the account owner for an email code. Brainerce reads the code of that one repository, read-only, through the App. It does not write to your repository.

Connect a repository by name: GitHub Actions publishes on a push to main

Type owner/repository and press Connect. This route does not use the GitHub App, so there is no Publish now button and no publish-on-push switch. Instead a GitHub Actions workflow in your repository publishes when you push to the main branch:

  • Ask your developer or AI tool to run npx create-brainerce-store add-hosting --github-actions, commit the workflow file .github/workflows/brainerce-hosted.yml and push to main.
  • The workflow proves who it is to Brainerce on every run and receives a key that works for one hour. No key or secret is stored in your repository.
  • A public repository is confirmed right away. A private one is confirmed by its first deploy, which must happen within seven days.
  • GitHub Actions runs under your GitHub account and your GitHub plan. If GitHub refuses to run Actions on your account (for example because of a failed GitHub payment), nothing publishes, and that is a GitHub matter, not a Brainerce one.

Disconnect removes a repository. It also switches off any publish key that repository already received.

GitHub publish problems

What you seeWhat to do
package.json is missing at the top of the repositoryThe project must be at the top level of the repository. Move it, or publish from your computer.
The GitHub App is not installed on this repositoryDisconnect, connect again with Connect with GitHub, and choose this repository.
The branch was not foundCreate the branch again in the repository, or disconnect and connect again if the default branch changed.
The build failedOpen the builder's message below the error. Common ones are written in plain words: the server code is too large or split into too many files, a static file is too large, there are too many static files, a package with a native add-on (sharp), child_process, jsdom / isomorphic-dompurify in the server code, a Next.js version older than 15.5.29 (or 16.4.5), npm that cannot resolve the dependencies (add legacy-peer-deps=true to a .npmrc file), a package-lock.json that does not match package.json (run npm install and commit it), a TypeScript error (run npm run build on your computer and fix it), a pnpm, yarn or bun project (commit a package-lock.json made with npm), or a fetch to a website that is not allowed while the shop builds (fetch that data when a visitor opens the page instead). Fix the code in the repository, push, publish again. Hosting does not fix build errors. See What hosting needs from a Next.js shop.
A file is too big (a video or a photo over 5 MB)Upload the file to your store's Assets (media library) and use the address it gives you (see Big videos and large images).
The repository is too large to buildRemove large or generated files from the repository, push, publish again.

Big videos and large images: my shop will not publish because a file is too big

Each file in your shop may be at most 5 MB, and all the files together at most 20 MB. A hero video of 12 MB, a few photos of 8 MB or a pile of full-size originals will stop the publish. The error names the file and its size, so you know which one to move. A file under 5 MB can stay in the project. This is a limit of Brainerce hosting, not of your computer, and it is the same for the command line and for Publish now from GitHub.

Do not make the video smaller and do not delete it. Upload it to your store's own files and use its address. Your store already has a place for files, the media library. Nothing is lost: the video keeps the quality you uploaded, the publish stays small and fast, and the shop plays the video from that address.

What to do, in this order:

  1. Upload the file to your store's Files and use the address it gives you. In the dashboard open Assets in the sidebar (the media library, called Files in Hebrew). Press Upload files, choose the video or photo, and wait for it to finish (keep the tab open for a large video). Click the file, press Copy URL, and paste the address to your developer or AI tool. Ask them to remove the big file from the project (the public folder or wherever it is) and put that address in the video tag or the image instead. An AI tool that cannot click in your dashboard will ask you to do exactly this upload and paste the address back to it: that is expected, not a failure.
    • What the library accepts: videos in MP4, WebM, MOV and M4V, up to 5 GB each within your plan's storage, and photos in JPEG, PNG, WebP, GIF and AVIF, up to 10 MB each. A photo is converted to WebP and scaled to 2048 pixels on its longest side. A photo over 10 MB is refused by the library: use an image service for it, or agree to make it smaller.
    • A shop built with Next.js: a plain <video> or a CSS background with the address needs nothing else. If the shop shows the picture through next/image, the host of that address must also be added to images.remotePatterns in next.config. Your developer or AI tool knows this line.
    • Connected AI tool: when the Brainerce admin MCP is connected to your AI tool, it can upload from a public link by itself (ingest_media_asset, or upload_media_asset) and read the address back with list_media_assets. Uploading from your dashboard works the same way without it.
  2. Or put the video on a video service such as Vimeo or YouTube (or a storage bucket you run yourself), and use its link. Choose this when you already use one.
  3. Compress the file only when a lower quality is fine and you ask for it: it must come under 5 MB, and the total must stay under 20 MB.

What hosting does not do: it does not shrink, convert or move your files for you, and it does not raise the 5 MB limit for one shop. A video that stays in your project folder and is over 5 MB cannot be published.

My shop's address on brainerce.app

Every site gets an address your-name.brainerce.app. When you create the site, type the name you want. The tab checks it as you type and offers other suggestions if it is taken.

  • 3 to 40 characters. Lowercase English letters, digits and single dashes, with no dash at the start or the end.
  • Some names are not available. A name that is already used, reserved or held for a custom domain shows as not available. The tab does not say which of those it is.
  • The name is chosen when the site is created. Plan on keeping it. To get a different name, delete the site and create it again.
  • Brainerce sets your shop's main address for you. It tells the shop its own address (the SITE_URL setting) and adds the address to your sales channel's allowed addresses, so you do not type it into the channel's allowed addresses list. If that list is already full, the address cannot be added, so free a place first.
  • Brainerce also fills the channel's Domain, and keeps it matching your shop's address. After a publish, when your own domain becomes Active, and when you remove a domain, Brainerce looks at the Domain field in your sales channel settings. On a Live channel, an empty Domain is filled for you with your shop's main address (your own domain once it is Active, otherwise your brainerce.app address). On a Test channel an empty Domain stays empty on purpose, so you can keep developing against localhost (your hosted address is already allowed, and a Test channel without a Domain accepts calls from any address). If the Domain holds your brainerce.app address or one of your own connected domains, Brainerce moves it to the current main address, so adding or removing your own domain keeps it right. A Domain that points somewhere else is never changed, because your store may live at another address. Your own edits always win.
  • Brainerce does not switch the channel to Live for you. A channel needs a Domain before it can go Live. When you switch a Test channel to Live and it asks for a Domain, set the Domain to your Brainerce address (your-name.brainerce.app) or to your own domain, then save. Do this yourself when you are ready to take real orders. A channel that is already Live stays Live.

Use my own domain on my hosted shop

Paid plan required. In Hosting → Domains type your domain, for example shop.example.com, and press Connect domain. A pasted address with https:// and a path is cleaned up for you.

  1. Type the domain.
  2. Add a CNAME record at your domain provider. The tab shows the exact record to add, with its target, right after you connect. Copy it from the tab. Do not copy it from another page, because it can differ.
  3. Brainerce checks it and issues the security certificate. The status goes from Waiting for DNS setup to Issuing security certificate to Active. Check now asks again at once. In our staging test a subdomain was serving the shop about two and a half minutes after the record was added.

What to know before you rely on it:

  • Up to five domains per site. The Brainerce address keeps working next to your own domain.
  • After the domain is Active, publish a new version once. Links inside the site then use your domain.
  • A subdomain such as shop.example.com is what we tested. Connecting a bare root domain such as example.com has not been tested, and your domain provider may not allow a CNAME on a root domain.
  • Brainerce's own domains cannot be connected. A domain of brainerce.com is refused.
  • Remove stops the domain serving the shop at once. To use it again it must be verified again.
  • We have not tested a full purchase on a hosted shop that uses a provider with a redirect or 3D Secure, on the Brainerce address or on your own domain. A complete checkout with the test payment was walked on a hosted shop, and a custom domain was shown serving the shop. Before you announce the address, place a test order with your real payment provider in test mode, on the address your shoppers will use.

Roll back to a previous version

In Hosting → Versions, the last ten published versions are listed. A version marked Ready to roll back has a Roll back to this button.

  1. Press Roll back to this on the version you want and confirm.
  2. That version becomes the live site within about a minute. The version that was live stays available, so you can roll forward again.
  3. If you publish from GitHub with Connect with GitHub, a rollback switches publish on every push off. Turn it back on when you want pushes to publish again.

Things a rollback does not do:

  • It does not roll back older than the last ten versions. An older version is marked Old and has no button.
  • It cannot go back to a version that used a secret you later revoked or removed. That version shows Needs a revoked secret and its button is off. Publish a new version instead.
  • It does not undo changes in your Brainerce store. Products, orders and prices are not part of a version.
  • It does not rebuild or fix your code. It switches the live site to a version that was already built.

Environment variables and secrets for my hosted shop

In Hosting → Variables and secrets you can add a setting your shop reads while it runs, or a key for an outside service.

  • Names: upper-case letters, digits and underscores, not starting with a digit, up to 64 characters. A site holds up to 50 variables and secrets, and a value can be up to 4,096 bytes.
  • A name containing KEY, SECRET, TOKEN or PASSWORD is saved as a secret. A secret is encrypted and can never be read again, only replaced or deleted. A normal variable's value shows in the list.
  • A change reaches the live site only after you press Apply changes. Until then it is marked as pending. Apply publishes a new version, without rebuilding your shop.
  • Names starting with NEXT_PUBLIC_ cannot be set here. They are baked into the shop when it is built. Change them in your project and publish a new build.
  • Some names belong to Brainerce and cannot be used: SITE_URL, BRAINERCE_API_URL, ASSETS, IMAGES, and names starting with CF_, CLOUDFLARE, HOSTING_ or __.
  • Deleting a secret removes it from the running site at once, before you press Apply, and it cannot be restored. An older version that used it can no longer be rolled back to.

Usage, allowances and billing

Usage this month (under Advanced) shows requests, failed requests and processing time for your site, plus a chart by day. It is refreshed once a day from a sample taken by Cloudflare, so it shows a trend and gives a warning. It is not an exact bill.

  • Brainerce does not bill hosting separately yet, and no monthly allowance is enforced. Do not read the usage numbers as a limit.
  • There are no per-plan promises about CPU time, requests or traffic. The platform may add allowances later.
  • A store that sends a flood of requests, or a shop that does something very heavy, can be slowed or suspended to protect other shops. A site can also be suspended by Brainerce staff.

What happens when my plan changes

  • If the store drops to the Free plan, its hosted sites are suspended. They stop serving visitors. You can still open the Hosting tab and delete a suspended site.
  • If the store moves back to a paid plan, the suspended sites are released. This happens by itself and can take a short while.
  • Changing between paid plans does not interrupt a site.

Delete the hosted site

Hosting → Delete the site stops the site being available at its address. Your store, products and orders are not deleted, and the versions cannot be restored. You confirm by typing the address. A sales channel that has a hosted site cannot be deleted until the site is removed.

Troubleshooting

What you seeWhat it means
The Hosting tab is locked with an upgrade promptThe store is on the Free plan. Hosting needs a paid plan.
There is no Hosting tabYour team role does not include View store settings. Ask the Owner.
Create the site or a publish says you cannotYour role may lack Manage integrations or Manage API keys (a Staff member does), or the store has reached its site limit.
The approval link says the code is wrong or has expiredThe request lasts ten minutes. Run npm run deploy:hosted again and approve the new link. Do not approve a code you did not ask for.
The build fails on my computerHosting does not fix build errors. Read the message, fix the project, publish again. On Windows see Publishing from Windows.
add-hosting says the folder is not a Next.js projectThere is no package.json, or it has no next in it. Run the command inside the shop folder. A static site or a single-page app (Vite, plain React) cannot be published yet.
build:hosted stops with one sentence about jsdom, child_process, sharp, writing files, a missing build script, output: 'export' or the Next.js versionSee What hosting needs from a Next.js shop.
The build says hosting needs Next 15.5.29 or newerYour shop uses an older Next.js. Upgrade next, commit package-lock.json and publish again. Next 14 and earlier cannot be published.
The build says it tried to reach a website that is not allowedA page fetches from another website (a CMS or an API) while it builds, and the build cannot reach any website except npm, Google Fonts and your Brainerce store. Fetch that data when a visitor opens the page, not at build time.
The build says this project builds with pnpm, yarn or bunHosting builds with npm only. Run npm install, commit the package-lock.json, publish again.
The build says npm could not resolve the dependenciesTwo packages ask for versions that conflict. Fix the versions, or add legacy-peer-deps=true to a .npmrc file in the project and commit it (Brainerce keeps that setting). A private package registry is not supported.
The shop publishes but shows an error page (500)A shop that imports isomorphic-dompurify or jsdom on the server does this on hosting. See Publish an older shop or any Next.js shop.
The address shows the old page for a few seconds after a publishThe site is live. The page was cached for a moment. Adding ?v=2 to the address shows the new one.
My own domain stays on Waiting for DNS setupBrainerce does not see the CNAME record yet. Check the record at your domain provider, then press Check now. If it never appears, remove the domain and connect it again.