Files
outline/app/env.ts
Apoorv Mishra 34e8a64b50 Share env vars client-side using @Public decorator (#6627)
* fix: public env vars using decorator

* fix: relocate

* fix: use env.public

* fix: register public env vars across plugins

* fix: test

* fix: tsc

* fix: mark remaining ones as public

* fix: move oidc ones to plugin

* fix: prevent overwrite

* fix: review
2024-03-09 14:48:59 +05:30

16 lines
301 B
TypeScript

declare global {
interface Window {
env: Record<string, any>;
}
}
const env = window.env;
if (!env) {
throw new Error(
"Config could not be be parsed. \nSee: https://docs.getoutline.com/s/hosting/doc/troubleshooting-HXckrzCqDJ#h-config-could-not-be-parsed"
);
}
export default env;