Reference Every export, config field, hook result, label and theme token.
Use this page to look up a name. If you are new, start with the
Quick start . Every command of the CLI is on CLI .
Export What it is PreviewProvider{ config: PreviewConfig, children }. Mount it near the root, on every startPreviewListThe ready-made list. Props: theme, labels, style usePreview()The list and its actions. Needs the provider above it useRunning()What this start runs, as a Running . Needs the provider usePreviewsState()The raw store state , without the provider useDevPreviewServersState(){ servers, activeUrl, error } for dev preview servers
What the app passes to the provider. Nothing here is read from the environment.
Field Needed What it is enabledYes true turns previews on. You decide per build; nothing is detectedurlYes With a read key: <endpoint>/<bucket>[/<folder>], the same as PREVIEW_S3_URL. Without one: any address the files are public under, such as that URL, https://pub-<id>.r2.dev or a CDN readAccessKeyIdNo A read-only key, for a private bucket. Never the write key readSecretAccessKeyNo Its secret regionNo Signing region for a private bucket. Default us-east-1; auto on R2 headersNo Extra headers on every read, for a proxy, CDN or tunnel in front of the bucket devPreviewServersNo Lists this app's Metro servers in a debug build. Default off. See Dev preview servers buildKeyNo This build's key, only when the config plugin is not used to bake it in
Field What it is enabledconfig.enableddevPreviewServersWhether dev preview servers are on itemsPreviewItem[] : this build's previews, and downloads it no longer listsincompatibleDownloads made for another native build loadingA refresh is running errorThe last error, as text, or null buildKeyThis build's key, or null without the plugin remoteWhat the bucket lists for this build. Null until it has answered once localEvery download on the device downloadingDownload progress by id, from 0 to 1 activeIdThe preview the next start loads, or null for the base bundle brokenIds of previews that stopped before they finished starting
Action What it does refresh()Reads the downloads, then asks the bucket for this build's list download(id)Downloads a preview, or its update switchTo(id)Restarts into a preview, downloading it first if needed switchTo(null)Back to base. Also stops a dev preview server remove(id)Deletes a download. If it runs, goes back to base first removeIncompatible()Deletes every download made for another native build
Field What it is idThe preview's id entryThe bucket's entry: title, branch, commit, author, publishedAt, appVersion, buildNumber, compatibility, fingerprint, size, changelog, revision, manifest statusavailable, downloading, downloaded, update-available, unpublished or brokenprogress0 to 1 while downloading, else null activeIt is the one the next start loads localThe download on the device, or null
kindFields basenone previewid, titlelocalurl, hostPort, server (null until the list has found it)
Function What it does selectPreview(id, key?)Chooses what the next start or reload() loads: a preview id, or null for the base bundle. False where the native module is missing reload()Restarts JS, so a new choice takes effect. False where the native module is missing previewBundlePath(id)Where a preview's bundle sits, relative to the preview folder markLaunched()Tells the native side this start worked. The provider calls it buildKey()The key the plugin baked into this build, or null buildCompatibility()appVersion or fingerprint, as baked in, or nullbuildSlug()The app's slug, as baked in, or null previewTitle(id)The readable title for an id: task-1-login-fix becomes "Task 1 login fix" previewItems(state){ items, incompatible } from the store staterunningNow(input)The pure form of useRunning() resolveTheme(theme, scheme)A full list theme from a partial one and the device's colour scheme
previewsStore and devPreviewServersStore are the stores behind the hooks, with getState() and
subscribe(), for use outside React.
PreviewList's theme takes any of these. LIGHT_THEME and DARK_THEME are the defaults.
Token What it colours modeauto (follows the device), light or dark. Default autobackgroundBehind the list cardEach card surfaceBehind the changelog and the progress track borderCard and button borders titleHeadings textBody text mutedQuiet text: branch, author, date, size primaryMain buttons primaryTextText on main buttons dangerDelete, and errors warningUpdate available, unpublished, and the Metro note successDownloaded radiusCard corner radius. Buttons scale from it. Default 14 fonts{ regular, medium, bold } font family names. Each falls back to the system font
PreviewList's labels takes any of these. DEFAULT_LABELS has the defaults.
Label Default titlePreviews runningRunning baseEmbedded bundle backToBaseBack to base metroBypassedDebug build: Metro is not used while a preview runs. Go back to base to load from Metro again. refreshRefresh emptyNo previews published for this build yet. noBuildKeyThis build has no compatibility key, so it cannot list previews. Add the config plugin and rebuild. downloadDownload switchToSwitch updateUpdate deleteDelete statusOne per status: Not downloaded, Downloading, Downloaded, Update available, Unpublished, Broken: it stopped while starting incompatibleTitleIncompatible incompatibleHintMade for another native build. They can't run on this one. deleteAllDelete all devPreviewServersTitleDev preview servers devPreviewServersHintMetro servers for this app on your computer. Debug builds only. noDevPreviewServersNo Metro server found. Start one with npx preview start. noBuildSlugThis build has no app slug, so it cannot tell its servers from other apps'. Add the config plugin and rebuild. stopDevPreviewServerStop using dev preview server localSuffixlocal localIncompatibleMade for another native build localUnknownBuildNative build unknown
status is merged per key, so labels={{ status: { broken: 'Crashed' } }} changes only that one.
[ "@axonpack/preview" , { "compatibility" : "appVersion" }]
Option Default Values compatibilityappVersionappVersion or fingerprint
See Compatibility for what it writes into the build.