Inferring types on the server

Is it also possible to infer the return-types of specific API routes on the server? I am creating a better-auth wrapper using effect-ts for my application and am missing some type-safety on the server.
serverClient.$Infer
serverClient.$Infer
gives the following type
(property) $Infer: {
Session: {
session: {};
user: {};
};
}
(property) $Infer: {
Session: {
session: {};
user: {};
};
}
1 Reply
Semaelse
SemaelseOP4mo ago
betterAuth({
appName: "Multa",
database: drizzleAdapter(database._drizzle, {
provider: "pg",
schema: schema,
}),
trustedOrigins: ["http://localhost:8002"],
socialProviders: {
github: {
clientId: Redacted.value(yield* Config.redacted("GITHUB_CLIENT_ID")),
clientSecret: Redacted.value(
yield* Config.redacted("GITHUB_CLIENT_SECRET"),
),
},
},
advanced: {
database: {
generateId: false,
},
cookiePrefix: "multa",
},
account: {
modelName: "accountsTable",
},
user: {
modelName: "usersTable",
},
session: {
modelName: "sessionsTable",
cookieCache: {
enabled: true,
maxAge: 5 * 60,
},
},
verification: {
modelName: "verificationsTable",
},
plugins: [],
});
betterAuth({
appName: "Multa",
database: drizzleAdapter(database._drizzle, {
provider: "pg",
schema: schema,
}),
trustedOrigins: ["http://localhost:8002"],
socialProviders: {
github: {
clientId: Redacted.value(yield* Config.redacted("GITHUB_CLIENT_ID")),
clientSecret: Redacted.value(
yield* Config.redacted("GITHUB_CLIENT_SECRET"),
),
},
},
advanced: {
database: {
generateId: false,
},
cookiePrefix: "multa",
},
account: {
modelName: "accountsTable",
},
user: {
modelName: "usersTable",
},
session: {
modelName: "sessionsTable",
cookieCache: {
enabled: true,
maxAge: 5 * 60,
},
},
verification: {
modelName: "verificationsTable",
},
plugins: [],
});
^ This is my config if that matters Okay, I think this might actually be a bug. Removing the plugin key (with an empty array as value) seems to fix the issue.

Did you find this page helpful?