# Runtime Helpers and stable imports

A Runtime Helper is the server function you import to use a ViteHub feature. It hides registries, provider bindings, and framework adapters. Each package page lists what it returns and which host resources it needs.

## Call the helper from server code

```ts [server/api/health.ts] fragment
import { useServerEnv } from 'vite-hub/env'

export function health() {
  const env = useServerEnv()
  return { environment: env.APP_ENV }
}
```

Use the import path from the feature page. Do not import `.vitehub` registry files: their structure can change.

## Keep configuration and runtime code separate

| Part | What it contains |
| --- | --- |
| Runtime Helper | The API your code calls. |
| Definition | Named config and behavior in your code. |
| Runtime Context | Host resources needed at run time. |
| Provider Output | Generated routes, bindings, functions, workers, or other host files. |

The helper reads Runtime Context, so you never build provider objects.

## Check an import failure

Check the import on the package page, the Vite plugin registration, and the generated types. See [Import paths](https://vitehub.dev/docs/reference/import-paths) for path rules and [Provider Output](https://vitehub.dev/docs/reference/provider-output) for generated files.

<!-- vitehub-docs:section-links -->
## In this section

- Setup
  - [Package reference](https://vitehub.dev/raw/docs/reference.md)
  - [Import paths](https://vitehub.dev/raw/docs/reference/import-paths.md)
  - [Runtime Helpers and stable imports](https://vitehub.dev/raw/docs/reference/runtime-helpers.md) (this page)
  - [File conventions](https://vitehub.dev/raw/docs/reference/file-conventions.md)
  - [Config options](https://vitehub.dev/raw/docs/reference/config-options.md)
- [Application APIs](https://vitehub.dev/raw/docs/reference/markdown-template-tutorial.md)
- [Runtime and output](https://vitehub.dev/raw/docs/reference/runtime-context.md)

Next: [File conventions](https://vitehub.dev/raw/docs/reference/file-conventions.md)

All pages: [llms.txt](https://vitehub.dev/llms.txt)
