Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fair-cows-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/astro": patch
---

Update existing env variables that is still using `PUBLIC_ASTRO_APP` prefix to `PUBLIC_`.
6 changes: 3 additions & 3 deletions packages/astro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ npm run dev
### Set environment variables

```sh
PUBLIC_ASTRO_APP_CLERK_PUBLISHABLE_KEY=pk_(test|live)_xxxxxxx
PUBLIC_CLERK_PUBLISHABLE_KEY=pk_(test|live)_xxxxxxx
CLERK_SECRET_KEY=sk_(test|live)_xxxxxxx

PUBLIC_ASTRO_APP_CLERK_SIGN_IN_URL=/sign-in # update this if sign in page exists on another path
PUBLIC_ASTRO_APP_CLERK_SIGN_UP_URL=/sign-up # update this if sign up page exists on another path
PUBLIC_CLERK_SIGN_IN_URL=/sign-in # update this if sign in page exists on another path
PUBLIC_CLERK_SIGN_UP_URL=/sign-up # update this if sign up page exists on another path
```

### Update `env.d.ts`
Expand Down
12 changes: 6 additions & 6 deletions packages/astro/src/internal/merge-env-vars-with-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const mergeEnvVarsWithParams = (params?: AstroClerkIntegrationParams & { publish
} = params || {};

return {
signInUrl: paramSignIn || import.meta.env.PUBLIC_ASTRO_APP_CLERK_SIGN_IN_URL,
signUpUrl: paramSignUp || import.meta.env.PUBLIC_ASTRO_APP_CLERK_SIGN_UP_URL,
isSatellite: paramSatellite || import.meta.env.PUBLIC_ASTRO_APP_CLERK_IS_SATELLITE,
proxyUrl: paramProxy || import.meta.env.PUBLIC_ASTRO_APP_CLERK_PROXY_URL,
domain: paramDomain || import.meta.env.PUBLIC_ASTRO_APP_CLERK_DOMAIN,
publishableKey: paramPublishableKey || import.meta.env.PUBLIC_ASTRO_APP_CLERK_PUBLISHABLE_KEY || '',
signInUrl: paramSignIn || import.meta.env.PUBLIC_CLERK_SIGN_IN_URL,
signUpUrl: paramSignUp || import.meta.env.PUBLIC_CLERK_SIGN_UP_URL,
isSatellite: paramSatellite || import.meta.env.PUBLIC_CLERK_IS_SATELLITE,
proxyUrl: paramProxy || import.meta.env.PUBLIC_CLERK_PROXY_URL,
domain: paramDomain || import.meta.env.PUBLIC_CLERK_DOMAIN,
publishableKey: paramPublishableKey || import.meta.env.PUBLIC_CLERK_PUBLISHABLE_KEY || '',
...rest,
};
};
Expand Down
8 changes: 4 additions & 4 deletions packages/astro/src/server/clerk-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ Missing domain and proxyUrl. A satellite application needs to specify a domain o
1) With middleware
e.g. export default clerkMiddleware({domain:'YOUR_DOMAIN',isSatellite:true});
2) With environment variables e.g.
PUBLIC_ASTRO_APP_CLERK_DOMAIN='YOUR_DOMAIN'
PUBLIC_ASTRO_APP_CLERK_IS_SATELLITE='true'
PUBLIC_CLERK_DOMAIN='YOUR_DOMAIN'
PUBLIC_CLERK_IS_SATELLITE='true'
`;

export const missingSignInUrlInDev = `
Expand All @@ -215,8 +215,8 @@ Check if signInUrl is missing from your configuration or if it is not an absolut
1) With middleware
e.g. export default clerkMiddleware({signInUrl:'SOME_URL', isSatellite:true});
2) With environment variables e.g.
PUBLIC_ASTRO_APP_CLERK_SIGN_IN_URL='SOME_URL'
PUBLIC_ASTRO_APP_CLERK_IS_SATELLITE='true'`;
PUBLIC_CLERK_SIGN_IN_URL='SOME_URL'
PUBLIC_CLERK_IS_SATELLITE='true'`;

function decorateAstroLocal(req: Request, context: APIContext, requestState: RequestState) {
const { reason, message, status, token } = requestState;
Expand Down
2 changes: 1 addition & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"CLERK_*",
"GATSBY_CLERK_*",
"NEXT_PUBLIC_CLERK_*",
"PUBLIC_ASTRO_APP_CLERK_*",
"PUBLIC_CLERK_*",
"NODE_ENV",
"NODE_VERSION",
"NPM_VERSION",
Expand Down