feat(cli): add polar as better-auth plugin (#578)

This commit is contained in:
Aman Varshney
2025-09-16 17:53:44 +05:30
committed by GitHub
parent 3f22373cc3
commit ba3d62b6b9
77 changed files with 1221 additions and 308 deletions

View File

@@ -1,16 +0,0 @@
import { createAuthClient } from "better-auth/vue";
export default defineNuxtPlugin(nuxtApp => {
const config = useRuntimeConfig()
const serverUrl = config.public.serverURL
const authClient = createAuthClient({
baseURL: serverUrl
})
return {
provide: {
authClient: authClient
}
}
})

View File

@@ -0,0 +1,22 @@
import { createAuthClient } from "better-auth/vue";
{{#if (eq payments "polar")}}
import { polarClient } from "@polar-sh/better-auth";
{{/if}}
export default defineNuxtPlugin((nuxtApp) => {
const config = useRuntimeConfig();
const serverUrl = config.public.serverURL;
const authClient = createAuthClient({
baseURL: serverUrl,
{{#if (eq payments "polar")}}
plugins: [polarClient()],
{{/if}}
});
return {
provide: {
authClient: authClient,
},
};
});