Environment Variables
Any number of environment variables can be defined in the schema, which will be placed in the Wrangler configuration and made available to the Worker at runtime.
Defining Environment Variables
Note
Variables are restricted to the same set of primitive types as SQLite Types.
To define an environment variable, use the var block in the schema:
var {
MY_VAR: string
MY_OTHER_VAR: int
}
Inject them into an API endpoint like so:
api Foo {
get bar -> string {
inject { MY_VAR }
}
}