System variables
Hiraiship sets these variables on every build, and attaches them to every deployed app with your runtime variables. Their values are the deployment's: a rollback brings back the old deployment's ID and commit.
| Key | Value |
|---|---|
HIRAISHIP | 1. Tells your code or build it runs on Hiraiship. |
HIRAISHIP_ENV | The environment's name: production, staging… |
HIRAISHIP_URL | The default address, https://<project>.hiraiship.app. Production only: other environments have no default address, so it isn't set there. |
HIRAISHIP_PROJECT_SLUG | The project's slug. |
HIRAISHIP_DEPLOYMENT_ID | The deployment's ID. |
HIRAISHIP_GIT_SHA | The commit built. Set when the deployment has one: from GitHub, or hiraiship deploy in a Git repository. |
HIRAISHIP_GIT_REF | The branch or tag a deployment from GitHub was asked to build. |
HIRAISHIP and every key starting with HIRAISHIP_ are reserved: a variable can't take one, and --build-env refuses them.
In a frontend
Vite and Rasengan.js only hand prefixed variables to your code (VITE_, RASENGAN_), so import.meta.env.HIRAISHIP_ENV is undefined. Read them in your config file and pass them on:
They count as bindings
A Worker has a limit of 128 variables and secrets; the system variables take up to 7 of them.