Skip to content

Commit 0d25aa5

Browse files
committed
docs: update Quickstart guide to use 'react-sample' as the application name and add user information display example
1 parent 9431713 commit 0d25aa5

File tree

1 file changed

+38
-5
lines changed

1 file changed

+38
-5
lines changed

packages/react/QUICKSTART.md

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ If you don't have a React application set up yet, you can create one using Vite:
3535

3636
```bash
3737
# Using npm
38-
npm create vite@latest teamspace --template react
38+
npm create vite@latest react-sample --template react
3939

4040
# Using pnpm
41-
pnpm create vite@latest teamspace --template react
41+
pnpm create vite@latest react-sample --template react
4242

4343
# Using yarn
44-
yarn create vite teamspace --template react
44+
yarn create vite react-sample --template react
4545
```
4646

4747
## Step 3: Install the SDK
@@ -86,7 +86,7 @@ Replace:
8686
- `<your-organization-base-url>` with the Base URL you noted in Step 1 (e.g., `https://api.asgardeo.io/t/<your-organization-name>`)
8787
- `<your-app-client-id>` with the Client ID from Step 1
8888

89-
## Step 4: Add Sign-in & Sign-out to Your App
89+
## Step 5: Add Sign-in & Sign-out to Your App
9090

9191
Update your `App.tsx` to include sign-in and sign-out functionality:
9292

@@ -110,7 +110,40 @@ function App() {
110110
export default App
111111
```
112112

113-
## Step 6: Try Login
113+
## Step 6: Display User Information
114+
115+
You can also display user information by using the `User` component & the `UserProfile` component:
116+
117+
```diff
118+
import { User, UserProfile } from '@asgardeo/react'
119+
import './App.css'
120+
121+
function App() {
122+
return (
123+
<>
124+
<SignedIn>
125+
+ <User>
126+
+ {({ user }) => (
127+
+ <div>
128+
+ <h1>Welcome, {user.username}</h1>
129+
+ <UserProfile />
130+
+ </div>
131+
+ )}
132+
+ </User>
133+
+ <UserProfile />
134+
<SignOutButton />
135+
</SignedIn>
136+
<SignedOut>
137+
<SignInButton />
138+
</SignedOut>
139+
</>
140+
)
141+
}
142+
143+
export default App
144+
```
145+
146+
## Step 7: Try Login
114147

115148
Run your application and test the sign-in functionality. You should see a "Sign In" button when you're not signed in, and clicking it will redirect you to the Asgardeo sign-in page.
116149

0 commit comments

Comments
 (0)