Skip to content

feat: add Privy logins page to admin dashboard#15

Merged
sweetmantech merged 18 commits intomainfrom
feature/privy-logins-page
Mar 17, 2026
Merged

feat: add Privy logins page to admin dashboard#15
sweetmantech merged 18 commits intomainfrom
feature/privy-logins-page

Conversation

@sweetmantech
Copy link
Copy Markdown
Contributor

New /privy page showing daily/weekly/monthly login counts and a table of individual logins with email, Privy DID, and timestamp. Adds "View Privy Logins" nav button to AdminDashboard.

New /privy page showing daily/weekly/monthly login counts and a
table of individual logins with email, Privy DID, and timestamp.
Adds "View Privy Logins" nav button to AdminDashboard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 2026

Warning

Rate limit exceeded

@sweetmantech has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 1 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 881b9f50-48ae-4ae7-9dea-636c2f360325

📥 Commits

Reviewing files that changed from the base of the PR and between 71a5110 and 5a5aba8.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • app/privy/page.tsx
  • components/Home/AdminDashboard.tsx
  • components/PrivyLogins/ChartSkeleton.tsx
  • components/PrivyLogins/PrivyLastSeenChart.tsx
  • components/PrivyLogins/PrivyLoginsPage.tsx
  • components/PrivyLogins/PrivyLoginsStats.tsx
  • components/PrivyLogins/PrivyLoginsTable.tsx
  • components/PrivyLogins/PrivyPeriodSelector.tsx
  • components/PrivyLogins/privyLoginsColumns.tsx
  • components/ui/card.tsx
  • components/ui/chart.tsx
  • hooks/usePrivyLogins.ts
  • lib/privy/getEmail.ts
  • lib/privy/getLastSeen.ts
  • lib/privy/getLastSeenByDate.ts
  • lib/recoup/fetchPrivyLogins.ts
  • package.json
  • types/privy.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/privy-logins-page
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
admin Ready Ready Preview Mar 17, 2026 6:16pm

Request Review

- Add 'all' period (new default) to period selector
- Update types to use full Privy User objects instead of filtered rows
- Add total_new, total_active, total_privy_users to response type
- Show new/active/total counts in the UI
- Extract email from linked_accounts in table
- Convert created_at from seconds to Date

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
{logins.map((login) => {
const email = getEmail(login);
return (
<TableRow key={login.id}>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SRP

  • actual: row defined in the table
  • required: new file for the row component

…om type

DRY - removed PrivyLinkedAccount and custom PrivyUser type definitions,
now re-exports User from the Privy SDK.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- PrivyLoginRow: single table row component
- PrivyPeriodSelector: period toggle buttons
- PrivyLoginsStats: new/active/total counts display

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
types/privy.ts Outdated
total_new: number;
total_active: number;
total_privy_users: number;
logins: import("@privy-io/react-auth").User[];
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you doing an inline import instead of using PrivyUser[] here?

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The React SDK's User type uses camelCase (createdAt: Date) but our API
returns the raw Privy Management API shape with snake_case (created_at: number).
Define our own type to match the actual response.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… as string

Index signature [key: string]: unknown was overriding the explicit
address?: string property, causing it to resolve as unknown.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sweetmantech and others added 3 commits March 17, 2026 12:53
Shows the most recent latest_verified_at across all linked accounts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sweetmantech and others added 2 commits March 17, 2026 12:55
…columns

Uses @tanstack/react-table and SortableHeader, matching the pattern
from SandboxesTable. Default sort: Created At descending.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Shows daily last seen activity counts as a line chart above the table.
Uses shadcn ChartContainer with Recharts LineChart. Data grouped by
date via getLastSeenByDate helper.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Recharts v3 removed payload from the Tooltip component props type.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Removed manually downloaded chart.tsx and reinstalled properly
via npx shadcn@latest add chart for correct Recharts v3 types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sweetmantech sweetmantech merged commit 45371cc into main Mar 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant