Skip to content

feat: migrate all examples to @dynamic-labs-sdk JS SDK v1.4.0 - #68

Open
avneesh0612 wants to merge 4 commits into
mainfrom
feat/migrate-all-to-js-sdk
Open

feat: migrate all examples to @dynamic-labs-sdk JS SDK v1.4.0#68
avneesh0612 wants to merge 4 commits into
mainfrom
feat/migrate-all-to-js-sdk

Conversation

@avneesh0612

@avneesh0612 avneesh0612 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates examples from the legacy `@dynamic-labs/*` v4.x SDK to the new headless `@dynamic-labs-sdk/{client,react-hooks,evm,solana}` v1.4.0 SDK.

Excluded (separate PRs or out of scope): nextjs-kalshi-demo, nextjs-polymarket-demo, nextjs-bridge-swaps-lifi, nextjs-global-payments-blindpay.

Version-bumped (already on new SDK, bumped 1.2.1→1.4.0)

  • nextjs-bridge-mayan — `addWaasEvmExtension`, `autoInitialize: false`, updated providers
  • nextjs-defi-lending-morpho — same pattern
  • nextjs-stablecoin-yield-aave — same pattern
  • nextjs-stablecoin-yield-kamino — Solana variant with `addWaasSolanaExtension`
  • nextjs-stablecoin-yield-pods — same pattern

Fully migrated from `@dynamic-labs/*`

  • nextjs-delegated-access — server-side `node-evm` and JWT auth files untouched; full delegation flow via `delegateWaasKeyShares`/`revokeWaasDelegation`
  • nextjs-external-wallets — `useUserWallets`/connector APIs → `useWalletAccounts`; simplified to embedded WaaS model
  • nextjs-gasless-relayer — Solana: `getSigner().signTransaction()` → `signTransaction(…, dynamicClient)` from `@dynamic-labs-sdk/solana`
  • nextjs-gateway-arc — wagmi removed; `useWriteContract`/`useWalletClient` → `createWalletClientForWalletAccount` + `createPublicClient`
  • nextjs-sidebar — JS (not TS); full new-SDK pattern
  • nextjs-stablecoin-card-rain — ZeroDev/AA removed; `useTokenBalances` → viem ERC-20; server-side card API preserved
  • vite-linera-counter — `import.meta.env.VITE_*`; `isEthereumWallet` → `isEvmWalletAccount`
  • vite-stablecoin-payment-links — `import.meta.env.VITE_*`; connector-based network switching removed

Key API changes applied

Old New
`DynamicContextProvider` `DynamicProvider` + `DynamicBootstrap`
`addEvmExtension()` `addWaasEvmExtension(dynamicClient)` inside `initDynamic()`
`autoInitialize: true` (default) `autoInitialize: false` + explicit `initializeClient(dynamicClient)`
`useIsLoggedIn()` `useUser() !== null`
`useDynamicContext().primaryWallet` `useWalletAccounts().find(isEvmWalletAccount)`
`DynamicWidget` / `DynamicUserProfile` Custom `DynamicButton` (Google + Email OTP)
`getAuthToken()` `getAuthToken(dynamicClient)`
`wagmi` hooks `createWalletClientForWalletAccount` + `createPublicClient` (viem)
`onEvent` from client `useEvent` hook from `@dynamic-labs-sdk/react-hooks`

Test plan

  • Each migrated example builds without TS/lint errors (`npm run build`)
  • Auth flow works: Google sign-in redirect + Email OTP in each example

🤖 Generated with Claude Code

Migrates 14 examples from @dynamic-labs/* v4.x to the new headless
@dynamic-labs-sdk/{client,react-hooks,evm,solana} v1.4.0 SDK.

Version-bumped (were already on new SDK at v1.2.1/0.26.5):
- nextjs-bridge-mayan
- nextjs-defi-lending-morpho
- nextjs-stablecoin-yield-aave
- nextjs-stablecoin-yield-kamino
- nextjs-stablecoin-yield-pods

Fully migrated from @dynamic-labs/* SDK:
- nextjs-delegated-access
- nextjs-external-wallets
- nextjs-gasless-relayer
- nextjs-gateway-arc (wagmi removed → viem)
- nextjs-global-payments-blindpay (wagmi removed → viem)
- nextjs-sidebar
- nextjs-stablecoin-card-rain
- vite-linera-counter
- vite-stablecoin-payment-links

Key changes across all examples:
- DynamicContextProvider → DynamicProvider + DynamicBootstrap
- addEvmExtension/addSolanaExtension → addWaasEvmExtension/addWaasSolanaExtension
- autoInitialize: false with explicit initDynamic() + initializeClient()
- useIsLoggedIn/useDynamicContext → useUser/useWalletAccounts/useInitStatus
- DynamicWidget → custom DynamicButton (Google + Email OTP)
- getAuthToken() → getAuthToken(dynamicClient)
- wagmi hooks → createWalletClientForWalletAccount + createPublicClient (viem)
- Server-side files (node-evm, JWT auth) left untouched

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
kamino Error Error Jun 16, 2026 4:54pm
nextjs-agentic-payments-x402 Error Error Jun 16, 2026 4:54pm
nextjs-iron-ramp Ready Ready Preview, Comment Jun 16, 2026 4:54pm
predictions-market-demo Ready Ready Preview, Comment Jun 16, 2026 4:54pm

Request Review

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

There is no GitHub account connected to this Vercel account.

…ration)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Revert version bump from 1.10.0 → 1.4.0 across all examples
  (1.10.0 is not installable: wallet-connect@1.10.0 doesn't exist yet)
- Add QueryClientProvider from @tanstack/react-query to providers in
  nextjs-external-wallets, nextjs-gasless-relayer, vite-linera-counter,
  and vite-stablecoin-payment-links (following iron-ramp pattern)
- Add @tanstack/react-query dependency to those examples
- Update nextjs-delegated-access pnpm-lock.yaml with clean v1.4.0 resolution

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant