Skip to content

Conversation

@halvaradop
Copy link
Member

Description

This pull request introduces a new Astro integration example for Aura Auth. The example demonstrates an integration using Astro + React, covering both client-side and server-side rendering authentication flows.

The implementation is based on the existing Next.js App Router example and has been adapted to support Astro’s architecture and conventions.

Note

This integration example highlights the core purpose of the integration examples: to identify unexpected behaviors, unsupported values, and framework-specific limitations when using the @aura-stack/auth package across different libraries and frameworks.

In the Astro example, an issue was identified with environment variable resolution. Aura Auth currently reads environment variables via Node.js using process.env, while Astro (similar to Vite) exposes environment variables through import.meta.env.

Due to this incompatibility, the integration example cannot be fully completed at the moment, and this PR is marked as a draft.

Relevant code reference:

const defineOAuthEnvironment = (oauth: string) => {
const env = process.env
const clientIdSuffix = `${oauth.toUpperCase()}_CLIENT_ID`
const clientSecretSuffix = `${oauth.toUpperCase()}_CLIENT_SECRET`
const loadEnvs = OAuthEnvSchema.safeParse({
clientId: env[`AURA_AUTH_${clientIdSuffix}`] ?? env[`AUTH_${clientIdSuffix}`] ?? env[`${clientIdSuffix}`],
clientSecret: env[`AURA_AUTH_${clientSecretSuffix}`] ?? env[`AUTH_${clientSecretSuffix}`] ?? env[`${clientSecretSuffix}`],
})
if (!loadEnvs.success) {
const msg = JSON.stringify(formatZodError(loadEnvs.error), null, 2)
throw new AuthInternalError("INVALID_ENVIRONMENT_CONFIGURATION", msg)
}
return loadEnvs.data
}

A future enhancement is planned to add multi-environment variable support, allowing Aura Auth to read from different environment sources depending on the runtime.

Resources

@vercel
Copy link

vercel bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Review Updated (UTC)
auth Skipped Skipped Jan 29, 2026 3:06am
auth-nextjs-demo Skipped Skipped Jan 29, 2026 3:06am

@halvaradop halvaradop added the examples Example code, demos, or sample implementations. label Jan 29, 2026
@halvaradop halvaradop marked this pull request as draft January 29, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples Example code, demos, or sample implementations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant