Skip to content

Getting started

How do I get updates?

You're notified when a developer ships a new version.

  1. 1Scripts with a pending update are marked "Update available" in the dashboard. You also get an email (you can turn it off in Settings).
  2. 2Open the script and download the new version.
  3. 3Replace the old folder on your server and restart. No need to touch .env.

Update automatically from the command line

If you run many scripts or don't want to fetch updates by hand, you can install everything in your Library and keep it current with one command. The server needs Node.js 20 or newer.

  1. 1Create an account API key (lta_…) in Settings > API keys. It can only list and download the scripts in your Library; it isn't a license key.
  2. 2Add it to the server's .env as LATCH_API_KEY=lta_… (next to LATCH_LICENSE), or set it as an environment variable.
  3. 3In the server folder, run npx -y @heylatch/cli pull --all --to resources (--to mods on Hytale). Scripts already on their newest version are skipped; add --keep config.json for files you want to keep.

Where you run it is up to you. The simplest is the top of the script that starts your server, so it always starts on the newest versions.

start.bat (Windows)
@echo off
cd /d "%~dp0"
call npx -y @heylatch/cli pull --all --to resources
REM ...then start the server the way you do now
start.sh (Linux)
#!/bin/sh
cd "$(dirname "$0")"
npx -y @heylatch/cli pull --all --to resources
# ...then start the server the way you do now

On a schedule

You can also run it while the server is up. New versions load the next time the server restarts.

crontab
# every night at 05:00
0 5 * * * cd /srv/my-server && npx -y @heylatch/cli pull --all --to resources

GitHub Actions

If you manage your server from a repository, a scheduled job can pull new versions and commit them, and your own deploy does the rest. Add the key to the repository's secrets as LATCH_API_KEY.

.github/workflows/latch-update.yml
name: Update Latch scripts
on:
  schedule:
    - cron: "0 5 * * *"
  workflow_dispatch:
jobs:
  update:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npx -y @heylatch/cli pull --all --to resources
        env:
          LATCH_API_KEY: ${{ secrets.LATCH_API_KEY }}
      - run: |
          git config user.name "latch-update"
          git config user.email "latch-update@users.noreply.github.com"
          git add resources
          git diff --cached --quiet || git commit -m "chore: update Latch scripts"
          git push

Security updates

If the script's encryption key is rotated (for example after a leak), old packages stop opening and the console shows "this package is outdated". Download the latest package and replace the old one.