Dev mode

zp app dev runs your app from your machine inside the real Zuper webapp. Only your browser tab sees it; every other user keeps the deployed version.

zp app dev

The link opens the deployed development webapp, https://developmentv3.zuperpro.com/sdk. To use another Zuper webapp, such as one you run locally, set ZP_WEBAPP_URL (optional):

ZP_WEBAPP_URL=http://localhost:4200 zp app dev
  1. It builds the app, serves it on http://127.0.0.1:4876 (change it with --port), and prints a link. A second origin, such as a tunnel, goes in --origin <url>.
  2. Open the link. It works on any page of that webapp: put the same ?zuper_dev_port=…&zuper_dev_token=… on a record page to land on your app. Zuper removes both from the address bar at once.
  3. The first time, Chrome asks to let the site reach devices on your local network. Click Allow. If you blocked it, open the site's settings (the icon left of the address bar) and set Local network access to Allow.
  4. Your extensions show with a DEV badge, and a DEV bar at the bottom shows the app, the build state and a Stop button.
  5. Save a file and the page updates in well under a second, without a reload. A failed build shows its errors above the last good build, which keeps running. A change to server code only shows a notice; your next server call runs the new code.
  6. console.log in your UI code and ctx.log in server functions print in the terminal.

What to know

  • Dev mode lasts for that tab only. A reload keeps it; a new tab doesn't. Stop ends it.
  • Each run makes a new token. After you restart zp app dev, open the new link. The old one shows "This dev link is from an earlier zp app dev run".
  • Ctrl+C shows "Dev server stopped" in the tab.
  • Server functions in dev mode run on your machine with sample ctx.user and ctx.company, and ctx.secrets from .env.local in your app folder.
  • Adding or removing an extension reloads the page, because buttons, menus and tabs are placed when the page loads.

Did this page help you?