Skip to content

Commit fe26c49

Browse files
committed
bring back react to test
1 parent 91f6f3c commit fe26c49

1 file changed

Lines changed: 17 additions & 39 deletions

File tree

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

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,28 @@
11
---
2-
title: "Web (Next.js)"
3-
description: "Quickly add Sign in with Base and Base Pay to any Next.js app"
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."
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 Next.js 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 React app using the Base Account SDK.
99

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

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

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

2020
```bash yarn
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
21+
yarn create react-app base-account-quickstart
3222
cd base-account-quickstart
3323
```
3424
</CodeGroup>
3525

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

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

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';
52+
## 3. Replace src/App.js with this component
7053

54+
```jsx title="src/App.js" lineNumbers
7155
import React, { useState } from 'react';
7256
import { createBaseAccountSDK, pay, getPaymentStatus } from '@base-org/account';
7357
import { SignInWithBaseButton, BasePayButton } from '@base-org/account-ui/react';
7458

75-
export default function Home() {
59+
function App() {
7660
const [isSignedIn, setIsSignedIn] = useState(false);
7761
const [paymentStatus, setPaymentStatus] = useState('');
7862
const [paymentId, setPaymentId] = useState('');
@@ -202,6 +186,8 @@ export default function Home() {
202186
</div>
203187
);
204188
}
189+
190+
export default App;
205191
```
206192

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

215201
```bash
216-
npm run dev
202+
npm start
217203
```
218204

219205
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! 🎉
220206

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.
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.
222208

223209
## Next steps
224210

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>
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

0 commit comments

Comments
 (0)