---
title: "Over-the-air updates"
description: "Ship JavaScript and asset changes to your Expo app from wervt, without a store release."
canonical_url: "https://docs.lightdrop.cloud/guides/updates"
---
# Over-the-air updates

> Ship JavaScript and asset changes to your Expo app from wervt, without a store release.

A native app that uses a wervt app as its backend can get its updates from that app too. wervt
speaks the [Expo Updates protocol](https://docs.expo.dev/technical-specs/expo-updates-1/), so the
stock `expo-updates` library works: it asks `https://<app>.lightdrop.cloud/_wervt/updates/manifest` instead
of `u.expo.dev`. The runtime answers without booting the app. Bundles and assets stay in the app's
own [bucket](https://docs.lightdrop.cloud/guides/files), behind links that expire after an hour.

An update carries JavaScript, styles and assets. Native code still needs a new build; the
**runtime version** keeps updates away from builds they don't fit.

## Set up

Deploy the app once, so it has a bucket. Then get the code signing certificate. wervt makes one key
per app, and builds that embed the certificate refuse anything not signed with it. It's public:
commit it.

```bash
wervt updates certificate todos   # saves certs/wervt-updates.pem
npx expo install expo-updates
```

Point the app at wervt with the [`@wervt/expo`](https://docs.lightdrop.cloud/guides/native-apps) config plugin:

```json [app.json]
{
  "expo": {
    "runtimeVersion": { "policy": "fingerprint" },
    "plugins": [
      [
        "@wervt/expo",
        {
          "redirectUri": "dev.example.todos:/auth",
          "updates": {
            "app": "https://todos.lightdrop.cloud",
            "certificate": "./certs/wervt-updates.pem",
            "channel": "preview"
          }
        }
      ]
    ]
  }
}
```

`channel` defaults to `production`, or stays what the app config already sets. Make a new build:
all of this is compiled in.

<note>

Moving off EAS Update takes one build with the new URL and certificate. Installed builds keep asking
Expo until they're replaced, so anything they need before that still goes out through EAS.

</note>

## Publish

From the Expo project:

```bash
wervt updates publish todos --channel preview --message "Fix the score keyboard"
```

This runs `expo export`, works out the runtime version of each platform the way builds do
(`expo-updates runtimeversion:resolve`), uploads the files the bucket doesn't have yet and publishes
one update per platform. Devices download it on their next start and run it on the start after that.
`--platform ios` publishes one platform, `--dir` names another project.

In CI use a deploy token of the app (`wervt tokens`), with `WERVT_URL` and `WERVT_TOKEN` set as for
a [deploy](https://docs.lightdrop.cloud/guides/deploys). It can publish, but not roll back.

```bash
wervt updates list todos
wervt updates list todos --channel preview
```

**Updates** in the app's dashboard shows the same, per channel. wervt keeps the last 20 updates per
channel, platform and runtime version, and deletes files nothing refers to anymore. The files count
towards the bucket's quota.

## Roll back

```bash
wervt updates rollback todos --channel preview              # the update before the newest
wervt updates rollback todos --channel preview --embedded   # what's built into the app
```

Devices follow on their next start. Each rollback goes one update further back. Without `--runtime`
it applies to each platform's newest runtime version, so builds that are behind keep what they have,
and `--platform` limits it to one platform. The dashboard has the same under **Roll back**, and
[MCP](https://docs.lightdrop.cloud/guides/dashboard-mcp) as `updates.rollback`.

## Private apps

A public app gives updates to everyone. A private app only gives them to people on its list: anyone
else gets a plain "no update", not an error, so the app starts as usual.

That needs the person's token on the request. `expo-updates` checks by itself on launch, before any
of your code runs and without a fresh token, so private apps ask again once the session is loaded:

```ts [src/updates.ts]
import { fetchUpdate } from '@wervt/expo/updates'
import { wervt } from './wervt'

// True when an update is ready for the next start.
await fetchUpdate(wervt, { channel: 'preview' })
```

`channel` has to match the build: the headers set here replace the ones from the build. `useUpdates`
from `expo-updates` then reports the download as usual, e.g. for a "restart to update" banner.

<note>

`expo-updates` keeps these headers, and so the access token, in the app's preferences instead of
the keychain until the next call. The token is short-lived and only works for this app.

</note>

## Logs

Each manifest request is an entry of type `Update` in the app's [logs](https://docs.lightdrop.cloud/guides/logs), with platform,
runtime version, channel and the update it got, or `none`. Requests from people without access show
up as `no access`.


## Sitemap

See the full [sitemap](https://docs.lightdrop.cloud/sitemap.md) for all pages.
