mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
Merge dev into update-oauth-docs
This commit is contained in:
commit
21b284e6f1
@ -12,9 +12,21 @@ import { useAdminApp } from "../use-admin-app";
|
||||
|
||||
function TotalUsersDisplay() {
|
||||
const stackAdminApp = useAdminApp();
|
||||
const data = (stackAdminApp as any)[stackAppInternalsSymbol].useMetrics();
|
||||
const metrics = (stackAdminApp as any)[stackAppInternalsSymbol].useMetrics(false);
|
||||
const metricsIncludingAnonymous = (stackAdminApp as any)[stackAppInternalsSymbol].useMetrics(true);
|
||||
|
||||
return <>{data.total_users}</>;
|
||||
const anonymousUsersCount = metricsIncludingAnonymous.total_users - metrics.total_users;
|
||||
|
||||
return (
|
||||
<>
|
||||
{metrics.total_users}
|
||||
{anonymousUsersCount > 0 ? (
|
||||
<>
|
||||
{" "}(+ {anonymousUsersCount} anonymous)
|
||||
</>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default function PageClient() {
|
||||
|
||||
@ -28,6 +28,21 @@ export default {
|
||||
}
|
||||
```
|
||||
|
||||
Next, update or create a file in `convex/convex.config.ts`:
|
||||
|
||||
```ts
|
||||
import { defineApp } from "convex/server";
|
||||
import stackAuthComponent from "@stackframe/js/convex.config"; // Vanilla JS
|
||||
// or: import stackAuthComponent from "@stackframe/react/convex.config"; // React
|
||||
// or: import stackAuthComponent from "@stackframe/stack/convex.config"; // Next.js
|
||||
|
||||
|
||||
const app = defineApp();
|
||||
app.use(stackAuthComponent);
|
||||
|
||||
export default app;
|
||||
```
|
||||
|
||||
Then, update your Convex client to use Stack Auth:
|
||||
|
||||
```ts
|
||||
|
||||
Loading…
Reference in New Issue
Block a user