doc: update Next.js tutorial for Appwrite SDK v16+ compatibility#2722
doc: update Next.js tutorial for Appwrite SDK v16+ compatibility#2722MrTob wants to merge 5 commits intoappwrite:mainfrom
Conversation
- Migrated from positional to object-parameter style for database methods - Updated deprecated createRow, deleteRow, and listRows methods - Fixed TypeScript types: Models.Session to Models.User<Models.Preferences> - Changed user property access: userId to \$id, providerUid to email - Added TypeScript generics for type-safe API responses - Fixed state management with proper props drilling for real-time updates - Updated import paths to use Next.js path aliases (@/) - Updated deleteSession to use object parameter style Tested with appwrite@^21.5.0 and next@^16.1.6"
WalkthroughThis pull request refactors a Next.js tutorial spanning steps 4-7, introducing several interconnected changes. Step 4 updates the authentication hook to retrieve and manage user objects instead of sessions, adds registration and user-fetching functions, and switches to absolute import paths. Step 5 updates the navbar to display user names or emails. Step 6 refactors API calls to use options objects instead of positional arguments and updates method signatures. Step 7 converts IdeasForm and IdeasList components from internally managing state to accepting props (onAdd, ideas, loading, onRemove) and updates the home page to wire these components using custom hooks. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Updates the Next.js tutorial to fix breaking changes. The current tutorial contains deprecated method signatures and incorrect TypeScript types that prevent the code from working.
What's Changed
SDK Method Updates (Steps 6-7)
createRow,deleteRow,listRows)listRows<Idea>({})Authentication Model (Step 4)
Models.SessiontoModels.User<Models.Preferences>login()to fetch user after session creationdeleteSession()to use object parametersType Safety & API Changes
userId→$id,providerUid→name || email@/path aliasesState Management (Step 7)
Tested With
appwrite@^21.5.0next@^16.1.6Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.