mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 02:10:12 -06:00
Co-authored-by: Piyush Gupta <56182734+gupta-piyush19@users.noreply.github.com> Co-authored-by: Piyush Gupta <piyushguptaa2z123@gmail.com> Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com> Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
14 lines
412 B
TypeScript
14 lines
412 B
TypeScript
import "server-only";
|
|
import { env } from "./env";
|
|
|
|
const WEBAPP_URL =
|
|
env.WEBAPP_URL ?? (env.VERCEL_URL ? `https://${env.VERCEL_URL}` : "") ?? "http://localhost:3000";
|
|
|
|
/**
|
|
* Returns the public domain URL
|
|
* Uses PUBLIC_URL if set, otherwise falls back to WEBAPP_URL
|
|
*/
|
|
export const getPublicDomain = (): string => {
|
|
return env.PUBLIC_URL && env.PUBLIC_URL.trim() !== "" ? env.PUBLIC_URL : WEBAPP_URL;
|
|
};
|