Skip to content

Commit

Permalink
feat(core): add render preset (#239)
Browse files Browse the repository at this point in the history
Co-authored-by: Julius Marminge <[email protected]>
  • Loading branch information
Gomah and juliusmarminge authored Jul 22, 2024
1 parent edd7cc5 commit 8737daf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/shiny-frogs-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@t3-oss/env-core": minor
---

add render preset
1 change: 1 addition & 0 deletions docs/src/app/docs/customization/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ T3 Env ships the following presets out of the box, all importable from the `/pre

- `vercel` - Vercel environment variables. See full list [here](https://vercel.com/docs/projects/environment-variables/system-environment-variables#system-environment-variables).
- `uploadthing` - All environment variables required to use [UploadThing](https://uploadthing.com/). More info [here](https://docs.uploadthing.com/getting-started/appdir#add-env-variables).
- `render` - Render environment variables. See full list [here](https://docs.render.com/environment-variables#all-runtimes).

<Callout type="info">

Expand Down
25 changes: 25 additions & 0 deletions packages/core/src/presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,28 @@ export const uploadthing = () =>
},
runtimeEnv: process.env,
});

/**
* Render System Environment Variables
* @see https://docs.render.com/environment-variables#all-runtimes
*/
export const render = () =>
createEnv({
server: {
IS_PULL_REQUEST: z.string().optional(),
RENDER_DISCOVERY_SERVICE: z.string().optional(),
RENDER_EXTERNAL_HOSTNAME: z.string().optional(),
RENDER_EXTERNAL_URL: z.string().url().optional(),
RENDER_GIT_BRANCH: z.string().optional(),
RENDER_GIT_COMMIT: z.string().optional(),
RENDER_GIT_REPO_SLUG: z.string().optional(),
RENDER_INSTANCE_ID: z.string().optional(),
RENDER_SERVICE_ID: z.string().optional(),
RENDER_SERVICE_NAME: z.string().optional(),
RENDER_SERVICE_TYPE: z
.enum(["web", "pserv", "cron", "worker", "static"])
.optional(),
RENDER: z.string().optional(),
},
runtimeEnv: process.env,
});

0 comments on commit 8737daf

Please sign in to comment.