Thanks for this, this really helped!
For anyone using TypeScript, you will need to declare the constant as a type. The easiest way to do this is to create a global.d.ts file in /src/admin/@types with the following:
declare const CUSTOM_VARIABLES: {
CLIENT_URL: string;
};