Skip to content

Commit 55bf3aa

Browse files
committed
update web react page to test llms.txt update
1 parent 91b6ad5 commit 55bf3aa

File tree

1 file changed

+39
-17
lines changed

1 file changed

+39
-17
lines changed

docs/base-account/quickstart/web-react.mdx

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,40 @@
11
---
2-
title: "Web (React)"
3-
description: "This quick-start shows the minimum code required to add Sign in with Base and Base Pay to any React app using the Base Account SDK."
2+
title: "Web (Next.js)"
3+
description: "Quickly add Sign in with Base and Base Pay to any Next.js app"
44
---
55

66
import { GithubRepoCard } from "/snippets/GithubRepoCard.mdx"
77

8-
This quick-start shows the **minimum** code required to add Sign in with Base and Base Pay to any React app using the Base Account SDK.
8+
This quick-start shows the **minimum** code required to add Sign in with Base and Base Pay to any Next.js app using the Base Account SDK.
99

10-
## 1. Create a new React app
10+
## 1. Create a new Next.js app
1111

12-
If you're starting fresh, create a new React app:
12+
If you're starting fresh, create a new Next.js app:
1313

1414
<CodeGroup>
1515
```bash npm
16-
npx create-react-app base-account-quickstart
16+
npx create-next-app@latest base-account-quickstart
1717
cd base-account-quickstart
1818
```
1919

2020
```bash yarn
21-
yarn create react-app base-account-quickstart
21+
yarn create next-app base-account-quickstart
22+
cd base-account-quickstart
23+
```
24+
25+
```bash pnpm
26+
pnpm create next-app base-account-quickstart
27+
cd base-account-quickstart
28+
```
29+
30+
```bash bun
31+
bunx create-next-app base-account-quickstart
2232
cd base-account-quickstart
2333
```
2434
</CodeGroup>
2535

36+
When prompted during setup, you can choose the default options or customize as needed. For this quickstart, the default settings work perfectly.
37+
2638
## 2. Install the SDK
2739

2840
<CodeGroup>
@@ -49,14 +61,18 @@ bun add @base-org/account @base-org/account-ui
4961
Use `--legacy-peer-deps` flag if you get a peer dependency error.
5062
</Tip>
5163

52-
## 3. Replace src/App.js with this component
64+
## 3. Create the main component
65+
66+
Replace the contents of `app/page.tsx` (or `app/page.js` if not using TypeScript) with this component:
67+
68+
```jsx title="app/page.tsx" lineNumbers
69+
'use client';
5370

54-
```jsx title="src/App.js" lineNumbers
5571
import React, { useState } from 'react';
5672
import { createBaseAccountSDK, pay, getPaymentStatus } from '@base-org/account';
5773
import { SignInWithBaseButton, BasePayButton } from '@base-org/account-ui/react';
5874

59-
function App() {
75+
export default function Home() {
6076
const [isSignedIn, setIsSignedIn] = useState(false);
6177
const [paymentStatus, setPaymentStatus] = useState('');
6278
const [paymentId, setPaymentId] = useState('');
@@ -186,8 +202,6 @@ function App() {
186202
</div>
187203
);
188204
}
189-
190-
export default App;
191205
```
192206

193207
<Note>
@@ -199,15 +213,23 @@ Make sure to replace `0xRecipientAddress` with your recipient address.
199213
## 4. Start your app
200214

201215
```bash
202-
npm start
216+
npm run dev
203217
```
204218

205219
Open http://localhost:3000, click **Sign in with Base** (optional) and then **Pay**, approve the transaction, and you've sent 5 USDC on Base Sepolia—done! 🎉
206220

207-
**Note:** If you have an existing React app, just install the SDK (`npm install @base-org/account`) and add the component above to your project.
221+
**Note:** If you have an existing Next.js app, just install the SDK (`npm install @base-org/account @base-org/account-ui`) and add the component above to your project. For other React frameworks, you can adapt this component as needed.
208222

209223
## Next steps
210224

211-
* **[Request profile data](/base-account/guides/accept-payments#collect-user-information-optional)** – ask the user for email, shipping address, etc. during `pay()`
212-
* **[Sub Accounts guide](/base-account/improve-ux/sub-accounts)** – embed gas-less child wallets inside your app
213-
* **[Mobile quick-start](/base-account/quickstart/mobile-integration)** – the same flow for React Native
225+
* **[Authenticate Users](/base-account/guides/authenticate-users)** strong authentication by setting up Sign in with Base with backend verification
226+
* **[Accept Payments](/base-account/guides/accept-payments)** explore all the features of Base Pay
227+
* **[Sign in with Base Button](/base-account/reference/ui-elements/sign-in-with-base-button)** – implement full SIWE authentication with backend verification
228+
* **[Base Pay Button](/base-account/reference/ui-elements/base-pay-button)** – collect user information during payment flow
229+
230+
<Warning>
231+
**Please Follow the Brand Guidelines**
232+
233+
If you intend on using the `SignInWithBaseButton` or `BasePayButton`, please follow the [Brand Guidelines](/base-account/reference/ui-elements/brand-guidelines) to ensure consistency across your application.
234+
235+
</Warning>

0 commit comments

Comments
 (0)