feat(astro): Add support for type-safe environment variables#5104
Conversation
🦋 Changeset detectedLatest commit: 8f9508b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| "inlineSources": false, | ||
| "isolatedModules": true, | ||
| "moduleResolution": "node", | ||
| "moduleResolution": "Bundler", |
There was a problem hiding this comment.
We need to update this to properly resolve imports from packages that use export maps (like astro/config)
| function createIntegration<Params extends HotloadAstroClerkIntegrationParams>() { | ||
| return (params?: Params): AstroIntegration => { | ||
| const { proxyUrl, isSatellite, domain, signInUrl, signUpUrl } = params || {}; | ||
| const { proxyUrl, isSatellite, domain, signInUrl, signUpUrl, enableEnvSchema = false } = params || {}; |
There was a problem hiding this comment.
Since this is primarily for convenience and doesn't affect the core functionality of our integration, should we just enable it by default?
There was a problem hiding this comment.
Yeah, since it's stable in Astro 5 I'd say let's enable it by default and change our docs/quickstart to use it 👍 I guess it's good to give the ability to turn it off in case someone want's to override it (assuming Astro doesn't merge the schema, dunno)
|
!snapshot |
|
Hey @wobsoriano - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/astro@2.2.0-snapshot.v20250208004744 --save-exact
npm i @clerk/backend@1.24.0-snapshot.v20250208004744 --save-exact
npm i @clerk/chrome-extension@2.2.8-snapshot.v20250208004744 --save-exact
npm i @clerk/clerk-js@5.52.2-snapshot.v20250208004744 --save-exact
npm i @clerk/elements@0.22.21-snapshot.v20250208004744 --save-exact
npm i @clerk/clerk-expo@2.7.6-snapshot.v20250208004744 --save-exact
npm i @clerk/expo-passkeys@0.1.19-snapshot.v20250208004744 --save-exact
npm i @clerk/express@1.3.47-snapshot.v20250208004744 --save-exact
npm i @clerk/fastify@2.1.20-snapshot.v20250208004744 --save-exact
npm i @clerk/localizations@3.10.5-snapshot.v20250208004744 --save-exact
npm i @clerk/nextjs@6.11.2-snapshot.v20250208004744 --save-exact
npm i @clerk/nuxt@1.1.3-snapshot.v20250208004744 --save-exact
npm i @clerk/clerk-react@5.22.12-snapshot.v20250208004744 --save-exact
npm i @clerk/react-router@1.0.7-snapshot.v20250208004744 --save-exact
npm i @clerk/remix@4.4.23-snapshot.v20250208004744 --save-exact
npm i @clerk/shared@2.21.0-snapshot.v20250208004744 --save-exact
npm i @clerk/tanstack-start@0.9.5-snapshot.v20250208004744 --save-exact
npm i @clerk/testing@1.4.21-snapshot.v20250208004744 --save-exact
npm i @clerk/themes@2.2.17-snapshot.v20250208004744 --save-exact
npm i @clerk/types@4.45.1-snapshot.v20250208004744 --save-exact
npm i @clerk/ui@0.3.22-snapshot.v20250208004744 --save-exact
npm i @clerk/vue@1.1.11-snapshot.v20250208004744 --save-exact |
| function createIntegration<Params extends HotloadAstroClerkIntegrationParams>() { | ||
| return (params?: Params): AstroIntegration => { | ||
| const { proxyUrl, isSatellite, domain, signInUrl, signUpUrl } = params || {}; | ||
| const { proxyUrl, isSatellite, domain, signInUrl, signUpUrl, enableEnvSchema = false } = params || {}; |
There was a problem hiding this comment.
Yeah, since it's stable in Astro 5 I'd say let's enable it by default and change our docs/quickstart to use it 👍 I guess it's good to give the ability to turn it off in case someone want's to override it (assuming Astro doesn't merge the schema, dunno)
Co-authored-by: Lennart <lekoarts@gmail.com>
Co-authored-by: Lennart <lekoarts@gmail.com>
Co-authored-by: Lennart <lekoarts@gmail.com>
ed1dfa7 to
4e1abb5
Compare
Description
This PR adds support for type-safe env variables in Astro.
While our integration continues to use
import.meta.envandprocess.envinternally, we now provide users the option to import Clerk environment variables in a type-safe way.When enabled, users can import our built-in variables like so:
Resolves ECO-119
Checklist
npm testruns as expected.npm run buildruns as expected.Type of change