Codetje docs

Settings and secrets

Each package has settings that decide what it gets at run time. They belong to the package, not to a version, so they apply to every version and tag, previews included. Change them in the console's settings panel or with rt settings set. The runner picks up changes within about ten seconds.

rt settings show acme/app
rt settings set acme/app --public true
rt settings set acme/app --env API_KEY          # asks for the value
rt settings set acme/app --env REGION=eu --unset OLD_NAME
rt settings set acme/app --allow-fetch https://api.example.com,https://example.org
rt settings set acme/app --no-fetch

Options you leave out stay as they are.

Public and private

Packages are private until you make them public.

  • A private package is invisible to everyone outside its namespace: its listing, versions, source, WIT and module bytes all answer 404, as if it didn't exist. Running it needs a credential for its namespace, so a browser opening its module host gets an error.
  • A public package can be read by anyone, and run by anyone, on its module host or at /run/....

To serve a website or an open API, make the package public. To keep a tool to yourself, leave it private and call it with a token.

Making a package private again also stops other namespaces' packages that import it from running it.

Environment variables

The environment is empty except for the variables you set. Use it for configuration and secrets, never the source code: source can be read by anyone who can read the package.

Values are write-only. rt settings show and the console list the names, and only the runner gets the values. The registry stores each one encrypted.

Fetching

A module can only send requests to the origins in its settings, and only to public addresses: private and internal networks are always refused. * allows any public origin. The list is empty by default, so a new package can't fetch anything.

An origin is a scheme, host and optional port, like https://api.example.com. A request to anything else fails, which the AssemblyScript SDK reports as http-request-denied.

Importable

--importable decides whether packages in other namespaces may import this one, while it's public. It's on by default. Turning it off stops new packages from pinning it, but keeps the ones that already have. See Calling other packages.

Imports

When your package imports another one, that package runs with the environment and fetch origins you give it, never with its owner's. Set them per imported package:

rt imports show acme/dashboard
rt imports set acme/dashboard bob/weather --env API_KEY --allow-fetch https://api.weather.example

Logs

Whatever a package prints to stdout and stderr is streamed live to its owner, with errors from the runner, such as traps and timeouts. Watch it in the console's run panel, or with GET https://run.codetje.app/logs/{ns}/{name} (server-sent events, with a token). Logs aren't stored: you see what's printed while you're watching.

Each line is cut at 16 KiB. When a package imports another, that package's output goes to your log stream, labelled with its name and version.