diff --git a/examples/nextjs/README.md b/examples/nextjs/README.md
index c4033664..2be155b8 100644
--- a/examples/nextjs/README.md
+++ b/examples/nextjs/README.md
@@ -1,36 +1,25 @@
-This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
+# Sound.xyz SDK + Viem + Wagmi + Next.js Example
-## Getting Started
+This example uses:
-First, run the development server:
+- `Next.js` https://nextjs.org/
+- `Typescript` https://www.typescriptlang.org/
+- `Wagmi` https://wagmi.sh/
+- `Viem` https://viem.sh/
+- `Tailwind` https://tailwindcss.com/
+- `Tanstack Query` aka `React Query` https://tanstack.com/query
-```bash
-npm run dev
-# or
-yarn dev
-# or
-pnpm dev
-# or
-bun dev
-```
+With the help of libraries like:
-Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
+- `radix-ui/themes` https://www.radix-ui.com/
+- `Zod` https://zod.dev/
+- `Valtio` https://valtio.pmnd.rs/
-You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
+## Breakdown of important scripts
-This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
-
-## Learn More
-
-To learn more about Next.js, take a look at the following resources:
-
-- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
-- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
-
-You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
-
-## Deploy on Vercel
-
-The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
-
-Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
+- [./src/context/wagmi.tsx](./src/context/wagmi.tsx) **Wagmi** initialization and importing **Sound.xyz SDK**
+- [./src/context/wallet.ts](./src/context/wallet.ts) **Viem** initialization and importing **Sound.xyz SDK**, this integration will vary depending on custom wallet integration, this example only includes a secret-key implementation that is not suitable for production environments
+- [./src/context/sound.ts](./src/context/sound.ts) **Sound.xyz API + SDK** client initialization
+- [./src/app/v2/page.tsx](./src/app/v2/page.tsx) **Sound Edition V2 usage** (Tiered Editions)
+- [./src/app/v1/page.tsx](./src/app/v1/page.tsx) **Sound Edition V1 usage** (Previous Tiered Edition Upgrade)
+ - [./src/app/v1/sam/page.tsx](./src/app/v1/sam/page.tsx) **Sound Edition V1 with SAM/Sound Swap usage**
diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json
index 69ecdfd9..38df86ea 100644
--- a/examples/nextjs/package.json
+++ b/examples/nextjs/package.json
@@ -1,13 +1,13 @@
{
- "name": "nextjs",
+ "name": "soundxyz-sdk-nextjs-example",
"version": "0.1.0",
"private": true,
"scripts": {
- "prepare": "node pull-env.mjs",
- "dev": "next dev",
"build": "next build",
- "start": "next start",
- "lint": "next lint"
+ "dev": "next dev",
+ "lint": "next lint",
+ "prepare": "node pull-env.mjs",
+ "start": "next start"
},
"dependencies": {
"@fortawesome/free-solid-svg-icons": "^6.4.2",
@@ -15,7 +15,6 @@
"@radix-ui/themes": "^2.0.0",
"@soundxyz/sdk": "workspace:^",
"@tanstack/react-query": "^5.0.0",
- "immer": "^10.0.3",
"next": "13.5.5",
"react": "^18",
"react-dom": "^18",
diff --git a/examples/nextjs/pull-env.mjs b/examples/nextjs/pull-env.mjs
index b13025ba..bea313ce 100644
--- a/examples/nextjs/pull-env.mjs
+++ b/examples/nextjs/pull-env.mjs
@@ -10,3 +10,4 @@ await fetch('https://vault.dotenv.org/pull.txt', {
})
.then((response) => response.text())
.then((env) => promises.writeFile('.env', env))
+ .catch(console.error)
diff --git a/examples/nextjs/src/context/sound.ts b/examples/nextjs/src/context/sound.ts
index 903cb8e1..613c94ca 100644
--- a/examples/nextjs/src/context/sound.ts
+++ b/examples/nextjs/src/context/sound.ts
@@ -1,6 +1,9 @@
import { SoundAPI } from '@soundxyz/sdk/api/sound'
export const soundApi = SoundAPI({
+ // Remove this line to use the production API
apiEndpoint: 'https://preview.api.sound.xyz/graphql',
+
+ // Change with your own API key
apiKey: 'preview-no-key',
})
diff --git a/examples/nextjs/src/lib/persistence.ts b/examples/nextjs/src/lib/persistence.ts
index e11dfea4..4ce4c760 100644
--- a/examples/nextjs/src/lib/persistence.ts
+++ b/examples/nextjs/src/lib/persistence.ts
@@ -1,6 +1,4 @@
import { IS_SERVER } from '@/utils/constants'
-import type { Draft } from 'immer'
-import { produce } from 'immer'
import { parse, stringify } from 'superjson'
import { proxy, useSnapshot, type INTERNAL_Snapshot } from 'valtio'
@@ -16,7 +14,6 @@ export type PersistedStore = {
set: (value: Input) => Promise