Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions tutorials/client/sdks/web/next-js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@

### Next.js Project Setup
Let's start by bootstrapping a new Next.js application using [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
```shell
pnpm dlx create-next-app@latest <project_name>
<CodeGroup>

```shell npm
npx create-next-app@latest my-powersync-app
```

```shell yarn
yarn create next-app my-powersync-app
```

```shell pnpm
pnpm create next-app my-powersync-app
```

</CodeGroup>

When running this command you'll be presented with a few options. The PowerSync suggested selection for the setup options Next.js offers are:
```shell
Would you like to use TypeScript? Yes
Expand All @@ -29,7 +41,7 @@
```

<Warning>
Do not use Turbopack when setting up a new Next.js project as we’ll be updating the `next.config.ts` to use Webpack. This is done because we need to enable:

Check warning on line 44 in tutorials/client/sdks/web/next-js.mdx

View check run for this annotation

Mintlify / Mintlify Validation - vale-spellcheck

tutorials/client/sdks/web/next-js.mdx#L44

Did you really mean 'Turbopack'?
1. asyncWebAssembly
2. topLevelWait
</Warning>
Expand All @@ -40,10 +52,22 @@

In addition to this we'll also install [`@powersync/react`](https://www.npmjs.com/package/@powersync/react), which provides several hooks and providers for easier integration.

```shell
<CodeGroup>

```shell npm
npm install @powersync/web @journeyapps/wa-sqlite @powersync/react
```

```shell yarn
yarn add @powersync/web @journeyapps/wa-sqlite @powersync/react
```

```shell pnpm
pnpm install @powersync/web @journeyapps/wa-sqlite @powersync/react
```

</CodeGroup>

<Note>This SDK currently requires [@journeyapps/wa-sqlite](https://www.npmjs.com/package/@journeyapps/wa-sqlite) as a peer dependency.</Note>

## Next.js Config Setup
Expand Down