Skip to content

Commit

Permalink
preset fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge committed Jan 25, 2025
1 parent 23f7115 commit bb80923
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-schools-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@t3-oss/env-core": minor
---

update uploadthing preset to v7. add `uploadthingV6` for legacy config
5 changes: 5 additions & 0 deletions .changeset/yellow-carrots-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@t3-oss/env-core": patch
---

add neonVercel 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 @@ -97,6 +97,7 @@ env.VERCEL_URL; // string
T3 Env ships the following presets out of the box, all importable from the `/presets` entrypoint.

- `vercel` - Vercel environment variables. See full list [here](https://vercel.com/docs/projects/environment-variables/system-environment-variables#system-environment-variables).
- `neonVercel` - Neon provided system environment variables when using the Vercel integration. See full list [here](https://neon.tech/docs/guides/vercel-native-integration#environment-variables-set-by-the-integration).
- `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).
- `railway` - Railway provided system environment variables. See full list [here](https://docs.railway.app/reference/variables#railway-provided-variables).
Expand Down
16 changes: 13 additions & 3 deletions packages/core/src/presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const vercel = () =>
* Neon for Vercel Environment Variables
* @see https://neon.tech/docs/guides/vercel-native-integration#environment-variables-set-by-the-integration
*/
export const neon_vercel = () =>
export const neonVercel = () =>
createEnv({
server: {
DATABASE_URL: z.string(),
Expand All @@ -59,14 +59,24 @@ export const neon_vercel = () =>
runtimeEnv: process.env,
});

/**
* @see https://v6.docs.uploadthing.com/getting-started/nuxt#add-env-variables
*/
export const uploadthingV6 = () =>
createEnv({
server: {
UPLOADTHING_TOKEN: z.string(),
},
runtimeEnv: process.env,
});

/**
* @see https://docs.uploadthing.com/getting-started/appdir#add-env-variables
*/
export const uploadthing = () =>
createEnv({
server: {
UPLOADTHING_SECRET: z.string(),
UPLOADTHING_APP_ID: z.string().optional(),
UPLOADTHING_TOKEN: z.string(),
},
runtimeEnv: process.env,
});
Expand Down

0 comments on commit bb80923

Please sign in to comment.