create-better-t-stack 3.0.7 → 3.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-t-stack",
3
- "version": "3.0.7",
3
+ "version": "3.0.9",
4
4
  "description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  {{#if (eq orm "prisma")}}
2
- import { betterAuth, type BetterAuthOptions } from "better-auth";
2
+ import { betterAuth } from "better-auth";
3
3
  import { prismaAdapter } from "better-auth/adapters/prisma";
4
4
  {{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}}
5
5
  import { expo } from "@better-auth/expo";
@@ -10,7 +10,7 @@ import { polarClient } from "./lib/payments";
10
10
  {{/if}}
11
11
  import prisma from "@{{projectName}}/db";
12
12
 
13
- export const auth = betterAuth<BetterAuthOptions>({
13
+ export const auth = betterAuth({
14
14
  database: prismaAdapter(prisma, {
15
15
  {{#if (eq database "postgres")}}provider: "postgresql"{{/if}}
16
16
  {{#if (eq database "sqlite")}}provider: "sqlite"{{/if}}
@@ -67,7 +67,7 @@ export const auth = betterAuth<BetterAuthOptions>({
67
67
 
68
68
  {{#if (eq orm "drizzle")}}
69
69
  {{#if (or (eq runtime "bun") (eq runtime "node") (eq runtime "none"))}}
70
- import { betterAuth, type BetterAuthOptions } from "better-auth";
70
+ import { betterAuth } from "better-auth";
71
71
  import { drizzleAdapter } from "better-auth/adapters/drizzle";
72
72
  {{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}}
73
73
  import { expo } from "@better-auth/expo";
@@ -79,7 +79,7 @@ import { polarClient } from "./lib/payments";
79
79
  import { db } from "@{{projectName}}/db";
80
80
  import * as schema from "@{{projectName}}/db/schema/auth";
81
81
 
82
- export const auth = betterAuth<BetterAuthOptions>({
82
+ export const auth = betterAuth({
83
83
  database: drizzleAdapter(db, {
84
84
  {{#if (eq database "postgres")}}provider: "pg",{{/if}}
85
85
  {{#if (eq database "sqlite")}}provider: "sqlite",{{/if}}
@@ -135,7 +135,7 @@ export const auth = betterAuth<BetterAuthOptions>({
135
135
  {{/if}}
136
136
 
137
137
  {{#if (eq runtime "workers")}}
138
- import { betterAuth, type BetterAuthOptions } from "better-auth";
138
+ import { betterAuth } from "better-auth";
139
139
  import { drizzleAdapter } from "better-auth/adapters/drizzle";
140
140
  {{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}}
141
141
  import { expo } from "@better-auth/expo";
@@ -148,7 +148,7 @@ import { db } from "@{{projectName}}/db";
148
148
  import * as schema from "@{{projectName}}/db/schema/auth";
149
149
  import { env } from "cloudflare:workers";
150
150
 
151
- export const auth = betterAuth<BetterAuthOptions>({
151
+ export const auth = betterAuth({
152
152
  database: drizzleAdapter(db, {
153
153
  {{#if (eq database "postgres")}}provider: "pg",{{/if}}
154
154
  {{#if (eq database "sqlite")}}provider: "sqlite",{{/if}}
@@ -217,7 +217,7 @@ export const auth = betterAuth<BetterAuthOptions>({
217
217
  {{/if}}
218
218
 
219
219
  {{#if (eq orm "mongoose")}}
220
- import { betterAuth, type BetterAuthOptions } from "better-auth";
220
+ import { betterAuth } from "better-auth";
221
221
  import { mongodbAdapter } from "better-auth/adapters/mongodb";
222
222
  {{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}}
223
223
  import { expo } from "@better-auth/expo";
@@ -228,7 +228,7 @@ import { polarClient } from "./lib/payments";
228
228
  {{/if}}
229
229
  import { client } from "@{{projectName}}/db";
230
230
 
231
- export const auth = betterAuth<BetterAuthOptions>({
231
+ export const auth = betterAuth({
232
232
  database: mongodbAdapter(client),
233
233
  trustedOrigins: [
234
234
  process.env.CORS_ORIGIN || "",
@@ -279,7 +279,7 @@ export const auth = betterAuth<BetterAuthOptions>({
279
279
  {{/if}}
280
280
 
281
281
  {{#if (eq orm "none")}}
282
- import { betterAuth, type BetterAuthOptions } from "better-auth";
282
+ import { betterAuth } from "better-auth";
283
283
  {{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}}
284
284
  import { expo } from "@better-auth/expo";
285
285
  {{/if}}
@@ -288,7 +288,7 @@ import { polar, checkout, portal } from "@polar-sh/better-auth";
288
288
  import { polarClient } from "./lib/payments";
289
289
  {{/if}}
290
290
 
291
- export const auth = betterAuth<BetterAuthOptions>({
291
+ export const auth = betterAuth({
292
292
  database: "", // Invalid configuration
293
293
  trustedOrigins: [
294
294
  process.env.CORS_ORIGIN || "",
@@ -2,6 +2,7 @@ import { redirect } from "next/navigation";
2
2
  import Dashboard from "./dashboard";
3
3
  import { headers } from "next/headers";
4
4
  import { auth } from "@{{projectName}}/auth";
5
+ import { authClient } from "@/lib/auth-client";
5
6
 
6
7
  export default async function DashboardPage() {
7
8
  const session = await auth.api.getSession({
@@ -13,8 +14,10 @@ export default async function DashboardPage() {
13
14
  }
14
15
 
15
16
  {{#if (eq payments "polar")}}
16
- const { data: customerState } = await auth.api.customer.state({
17
- headers: await headers(),
17
+ const { data: customerState } = await authClient.customer.state({
18
+ fetchOptions: {
19
+ headers: await headers(),
20
+ },
18
21
  });
19
22
  {{/if}}
20
23