Skip to main content
Deploy a front end you built (React, Vue, Svelte or plain HTML) to https://{slug}.mxp.co, where it calls your retrievers through a proxy that adds your API key on the server. Mixpeek hosts the files, versions every deploy, and can add sign-in, a custom domain and server functions. Prerequisites
  • A Mixpeek API key in MIXPEEK_API_KEY and a namespace with a retriever. The Quickstart creates both.
  • A front end that builds to static files with an index.html, for example npm create vite@latest.
  • A plan that allows another app: Free allows 1 app, Pro 10, Enterprise unlimited. Custom domains, per-user sign-in management and GitHub deploys need Enterprise.

Deploy an app

1

Create the app

The slug is globally unique and becomes the URL. Only slug and meta are required.
cURL
In Studio: Apps, then Create App.
2

Build and zip your front end

Shell
3

Upload the bundle and start the deploy

The upload URL is valid for 3,600 seconds.
cURL
environment is production (the default) or staging. In Studio, drop the zip on the app’s Deploy panel instead. The mixpeek CLI runs the build, zip, upload and deploy as mixpeek apps deploy.
4

Wait for the build

cURL
status moves from queued to building to complete or failed. A failed deploy leaves the previous version live.

Check that it worked

Open https://night-scene-search.mxp.co. A staging deploy is at https://staging-night-scene-search.mxp.co. Every deploy also appears in GET /v1/apps/{app_id}/versions with its message.

Call your retrievers from the app

Call Mixpeek through relative /api/... paths. The proxy forwards the request to api.mixpeek.com with the app owner’s API key and namespace added on the server, so no key ships in your JavaScript and there is no CORS setup. Calls are billed to the organization that owns the app; visitors need no Mixpeek account.
src/search.js
The proxy allows only the calls a public page needs, because anyone who can load the page can send them with your key. A path outside the list answers 403. Create, update and delete routes, /v1/namespaces/list and organization routes are refused. To allow more paths for one app, set build_config.api_allow to a list of {methods, pattern} rules with PATCH /v1/apps/{app_id}.

Configuration and secrets

PATCH /v1/apps/{app_id} sets two kinds of values in build_config: Every env_vars entry except MIXPEEK_API_KEY is sent to the browser, so never put a secret there. window.__MIXPEEK__ also carries apiUrl, proxyPrefix (/api) and the app’s auth settings. Do not read process.env in browser code; it is undefined there.
Set a public value and a secret

Server functions

A file under api/ in your project becomes an endpoint at /functions/...: api/hello.ts answers GET and POST /functions/hello. Mixpeek compiles TypeScript with esbuild and runs the handler on the server. mixpeek apps deploy uploads api/ with the bundle.
api/visits.ts
Return {status, body, headers}; an object body is sent as JSON. console.log, warn, error and info go to the app’s runtime logs.

Sign-in, users and domains

Set auth_config.mode with PATCH /v1/apps/{app_id}:With clerk, Mixpeek loads a sign-in script and exposes window.MixpeekAuth: onReady(callback), isSignedIn, user (id, email, name, avatar_url), showSignIn(), showSignUp() and signOut(). /_auth/me returns the signed-in user.
Invites answer 400 when the app’s mode is not clerk. Studio shows a Users tab on clerk apps.
  1. POST /v1/apps/{app_id}/domains with {"domain": "search.example.com"}. The response has verification_token and cname_target.
  2. Add a TXT record _mixpeek-verify.search.example.com with the value mixpeek-site-verification={verification_token}.
  3. Add a CNAME from search.example.com to cname_target.
  4. POST /v1/apps/{app_id}/domains/search.example.com/verify. Mixpeek checks DNS for up to 72 hours and issues the TLS certificate.
Subdomains only; an apex domain cannot take a CNAME. The {slug}.mxp.co address keeps working.
POST /v1/apps/{app_id}/connect-repo with repo_url and branch connects a repository. Each push to the branch runs npm ci and npm run build, then deploys dist/, build/ or out/ to production. Your package.json needs a build script. Each pull request gets a preview at https://pr-{number}-{slug}.mxp.co, rebuilt on new commits and removed when the pull request closes. mixpeek apps preview lists them.

Versions, rollback and staging

Every deploy creates a numbered version with its message, file hashes and source files.

Logs and monitoring

Read an SSE stream with fetch and a reader; EventSource cannot send the Authorization header.

What goes wrong