---
url: https://kit.kambium.net/docs/updating.md
---
# Update your application

Kambium Kit packages are pre-1.0. A minor release can include breaking changes.
Review changes to the generated starter alongside dependency and schema changes.

For an agent-assisted upgrade, invoke `kambium-kit-upgrade` in your app. The
skill reviews the published npm packages, compares your app with the old and
new starters, and flags Desktop or CLI compatibility issues. See
[Coding-agent guidance](#coding-agent-guidance) if you need to add the skill
or replace an older pointer.

Review the npm package changes before installing. Update `@kambium/kit` and
`@kambium/cli` in your app's `package.json` and run `npm install` from the app
directory. Review the lockfile changes and start **Local Server** again in Desktop.
It imports and applies any local schema upgrades. Try your engine locally,
then commit dependency changes, the lockfile and any new SQL and schema metadata.

## Check dependencies

Commit `package-lock.json` after the first install and with every dependency
update. If the app is on GitHub, enable the dependency graph and Dependabot
alerts in the app repository. Alerts work independently of how you deploy.
[Configure Dependabot alerts](https://docs.github.com/en/code-security/how-tos/secure-your-supply-chain/secure-your-dependencies/configure-dependabot-alerts)

To check locally, run `npm audit` from the app directory. Use
`npm audit --omit=dev` to focus on production npm dependencies. npm sends
package names and versions to the configured registry for advisory matching.
[npm audit](https://docs.npmjs.com/cli/v10/commands/npm-audit/)

1. Read the advisory and confirm the affected version and dependency path.
   Check the deployed image's SBOM if you need to confirm production exposure.
2. Update the affected dependency, or the direct dependency that brings it in,
   to a release with a fix. Use the app's `kambium-kit-upgrade` skill if the fix
   requires newer Kit packages. Review and commit the manifest and lockfile
   changes together.
3. Run `npm ci` in a clean checkout, repeat the audit, and run
   `npm run test:server` and the local app flow affected by the change.
   [Clean npm installs](https://docs.npmjs.com/cli/commands/npm-ci/)
4. Deploy the verified change and [check the running app](https://kit.kambium.net/docs/verify-deployment.md).
   On Fly, [scan the new image's SBOM](https://oss.anchore.com/docs/guides/vulnerability/scan-targets/#sbom-scan-targets)
   when you need to verify a fix in the deployed image, including packages from
   the container's operating system.

## Hosted migrations and rollback

Before deploying, keep the previous build and back up persistent data. If the
update includes migrations, review their SQL and compatibility with the running
app. In the intended Desktop environment, use **Cloud → Supabase → Review
database setup** to apply them. Then redeploy and
[verify your app](https://kit.kambium.net/docs/verify-deployment.md#verify-the-deployment).

A previous build must support the migrated schema and stored data before you
roll back to it. A code rollback leaves applied migrations in place.
[Backend rollback on Fly](https://kit.kambium.net/docs/deployment.md#roll-back-the-backend)

::: details Apply a hosted upgrade from the terminal

From the app directory, target the project explicitly:

```sh
npm run db:upgrade -- --remote=your-project-ref
```

Use an authenticated Supabase CLI session. The project ref selects the database.
The Kit's schema metadata records imported files, while Supabase records
applied migrations.
[Supabase migration history](https://supabase.com/docs/reference/cli/supabase-migration-list)

:::

<span id="existing-app-scripts-unreleased"></span>
<span id="existing-app-scripts"></span>

::: details Database scripts in an existing app

Keep these database scripts in your app's `package.json`. Updating a dependency
does not rewrite application files:

```json
{
  "scripts": {
    "db:init": "kambium db init",
    "db:init:local": "kambium local up",
    "db:upgrade": "kambium db upgrade",
    "db:upgrade:local": "kambium local up"
  }
}
```

The base commands use the linked hosted database. The `:local` commands prepare
Supabase and Redis and apply migrations to the database used by `dev:local`,
without starting the app. Both local commands install the initial schema or
import upgrades according to existing metadata. They retain data and keys.
For an existing Docker stack, append `-- --docker`.

:::

<span id="coding-agent-guidance-unreleased"></span>
<span id="coding-agent-guidance"></span>

::: details Coding-agent guidance in an existing app

Review and copy the full upgrade skill into the app, replacing the older
`node_modules` pointer if present. Commit the file so future changes are visible
in the app's Git diff. See the [skill setup instructions](https://github.com/MartinMalinda/kambium/blob/main/packages/documentation/README.md#existing-apps).
Update `@kambium/documentation` and the lockfile to refresh the installed
development guides.

:::
