mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
Step 5: rename lowercase local vars stackApp/stackServerApp/stackClientApp/ stackAdminApp -> hexclave* across SDK source, apps, examples, and docs-mintlify (docs/ excluded). Public StackServerApp/StackClientApp classes and the useStackApp hook are unchanged. typecheck + lint green.
22 lines
864 B
TypeScript
22 lines
864 B
TypeScript
import { api } from "@/convex/_generated/api";
|
|
import { hexclaveClientApp } from "@/hexclave/client";
|
|
import { ConvexHttpClient, ConvexClient } from "convex/browser";
|
|
|
|
const convexHttpClient = new ConvexHttpClient(process.env.NEXT_PUBLIC_CONVEX_URL!);
|
|
|
|
export async function getUserInfoConvexHttpClient() {
|
|
const token = await hexclaveClientApp.getConvexHttpClientAuth({ tokenStore: "nextjs-cookie" });
|
|
convexHttpClient.setAuth(token);
|
|
const userInfo = await convexHttpClient.query(api.myFunctions.getUserInfo, {});
|
|
return userInfo;
|
|
}
|
|
|
|
|
|
const convexClient = new ConvexClient(process.env.NEXT_PUBLIC_CONVEX_URL!);
|
|
convexClient.setAuth(hexclaveClientApp.getConvexClientAuth({ tokenStore: "nextjs-cookie" }))
|
|
|
|
export async function getUserInfoConvexClient() {
|
|
const userInfo = await convexClient.query(api.myFunctions.getUserInfo, {});
|
|
return userInfo;
|
|
}
|