[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[Feedback](/c/feedback/8)

# Vercel should allow variable referencing

61 views · 0 likes · 2 posts


Albert (@dominus) · 2024-08-20

When building applications with vercel, sometimes we want to expose vercel system environment variables to the client, or building variables from parts

For example, I want to use the `VERCEL_GIT_COMMIT_REF` in my client-side frontend as `PUBLIC_NAMESPACE` for SvelteKit to allow it.

Sometimes, you may also want to do things like

`DB_PORT=8000`
`DB_HOST=example.com`
`DB_ENDPOINT=https://$DB_HOST:$DB_PORT/path`

Currently it doesn't seem possible to achieve something like this.

See also:
https://github.com/orgs/vercel/discussions/3621


Amy Egan (@amyegan) · 2024-09-04

Thanks for the suggestion! I've passed this feedback to the engineering team to consider for a feature update.

With Svelte, I would actually recommend using the steps outlined in the SvelteKit docs if you want to expose system env vars to the client: https://kit.svelte.dev/docs/adapter-vercel#environment-variables