Skip to content

Docs: add Next.js (App Router) example in examples/nextjs-app (#350) - #387

Merged
Jaydbrown merged 2 commits into
conduit-protocol:mainfrom
JafetCHVDev:main
Jul 30, 2026
Merged

Docs: add Next.js (App Router) example in examples/nextjs-app (#350)#387
Jaydbrown merged 2 commits into
conduit-protocol:mainfrom
JafetCHVDev:main

Conversation

@JafetCHVDev

Copy link
Copy Markdown
Contributor

Context

The \examples/\ folder currently only has a raw Node.js script and a Vite dashboard. This PR adds a modern Next.js (App Router) example.

Changes

  • Created \examples/nextjs-app/\ with a minimal Next.js 14 application
  • Main page displays active streams for a given Stellar address
  • Modal form to create new streams (recipient, token, amount, duration)
  • Withdraw action on each stream
  • Singleton \ConduitClient\ initialization via \lib/conduit.ts\
  • Stream operation helpers via \lib/streams.ts\
  • Environment variable configuration via .env.example\
  • Updated main \README.md\ with directory listing and run instructions

How to run

�ash npm install && npm run build cd examples/nextjs-app cp .env.example .env.local # fill in your keys npm run dev

Closes #350

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@JafetCHVDev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

JafetCHVDev and others added 2 commits July 30, 2026 07:00
Create a minimal Next.js example that demonstrates how to use
@conduit-protocol/sdk in a modern React framework:

- Fetch and list active streams for a given Stellar address
- Create a new stream via a modal form (recipient, token, amount, duration)
- Withdraw from an active stream
- Singleton ConduitClient initialization in lib/conduit.ts
- Helper functions for stream operations in lib/streams.ts

Closes conduit-protocol#350
- Move getClient()'s keypair-signing calls behind a 'use server' boundary
  (lib/streams.ts) and rename NEXT_PUBLIC_STELLAR_SECRET -> STELLAR_SECRET.
  The NEXT_PUBLIC_ prefix tells Next.js to inline the value into the
  client-side JS bundle, which would have shipped a real signing secret to
  every browser loading the page — verified by grepping the production
  build's client chunks for the env var name before and after this fix.
- Fix @conduit-protocol/sdk: "workspace:*" in the example's package.json,
  which fails with plain npm since this repo has no workspaces config
  (confirmed via `npm install --dry-run`); use "file:../.." instead, which
  resolves against the built dist/ output the README already has the
  reader `npm run build` before this step.
- Rename next.config.ts -> next.config.mjs: the pinned Next.js 14.2.x line
  doesn't support next.config.ts (that lands in a later major), so the
  build failed immediately with "Configuring Next.js via 'next.config.ts'
  is not supported."
- Add coverage/, examples/nextjs-app/.next/, and
  examples/nextjs-app/next-env.d.ts to .gitignore so generated output
  doesn't get committed by accident.

Verified: npm install, npm run build (SDK), then npm install && npx tsc
--noEmit && npm run build inside examples/nextjs-app all succeed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: Create a Next.js example in examples/

3 participants