© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Andrew Ross
Full Stack Engineer
Great article! For that client/server dependent secret you could use a ternary to further refine it.
const isServer = typeof window === “undefined”
fetch(${isServer ? process.env.BASE_URL : “ “}/api/hello).then...
${isServer ? process.env.BASE_URL : “ “}/api/hello