Skip to content

Conversation

@nbarbettini
Copy link
Collaborator

To make the quickstart and code examples easier to follow, this PR replaces all sample user IDs like [email protected] with a placeholder with either:

  • Your Arcade account email (if you are logged in)
  • A clear placeholder "{arcade_user_id"} if not

This change will help reduce confusion especially when #341 is merged.

@vercel
Copy link

vercel bot commented Jul 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2025 10:04pm

Copy link
Contributor

@evantahler evantahler left a comment

Choose a reason for hiding this comment

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

FWIW, the preview environment doesn't work for me, and I am signed on both bosslevel and prod
Screenshot 2025-07-10 at 1 50 43 PM

Comment on lines 9 to 11
const replacement = loading
? "{arcade_user_id}" // Keep original while loading
: email || "{arcade_user_id}";
Copy link
Contributor

Choose a reason for hiding this comment

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

FANCY

@nbarbettini nbarbettini requested a review from sdserranog July 10, 2025 20:57
Copy link
Contributor

@sdserranog sdserranog left a comment

Choose a reason for hiding this comment

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

Nice!

import { useOrySession } from "@/lib/OrySessionContext";
import { getCookie } from "@/lib/utils";

export function PlaceholderReplacer() {
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to change this now, but for the future. This approach can be a bit expensive. It searches every single text element on the page to find the placeholder and then mutates the DOM after the page has loaded.

We could improve this later in a couple of ways:

  1. Create a dedicated component to show the examples that consumes our OryContextProvider. So we can search/replace the placeholder only in the example.
  2. Use a Server Component to read the cookie and replace the placeholder on the server, which would prevent any client-side DOM mutation for the initial load.

useEffect(() => {
const checkSession = async () => {
try {
const { data: session } = await ory.toSession();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can also use a server component here to avoid a loading state

@nbarbettini nbarbettini marked this pull request as ready for review July 11, 2025 20:09
@nbarbettini nbarbettini merged commit e7f1faa into main Jul 11, 2025
4 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.

4 participants