-
Notifications
You must be signed in to change notification settings - Fork 0
Add mobile module to Base44 SDK for push notifications #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Implements mobile native capabilities in the SDK, allowing apps to send push notifications to users. This exposes the backend mobile API to LLM-generated apps through base44.mobile.sendNotification(). SDK changes: - Create mobile module with sendNotification() method - Add TypeScript types for mobile notifications - Add mobile module to Base44Client interface - Export mobile types from index.ts - Update README with mobile features documentation - Add comprehensive mobile notifications examples Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
|
Claude finished @gdauber1's task —— View job Code Review for Mobile Module PRI've completed my review of the mobile module implementation. Here's my comprehensive feedback: ✅ Code Quality and Best PracticesStrengths:
Minor Improvements:
|
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/[email protected]Prefer not to change any import paths? Install using npm alias so your code still imports npm i "@base44/sdk@npm:@base44-preview/[email protected]"Or add it to your {
"dependencies": {
"@base44/sdk": "npm:@base44-preview/[email protected]"
}
}
Preview published to npm registry — try new features instantly! |
Addresses all issues identified in the code review: 1. Type Safety: Changed metadata type from `any` to `Record<string, unknown>` for better type safety in mobile.types.ts 2. Input Validation: Added validateNotificationParams() function to enforce documented character limits: - Title: max 100 characters - Content: max 500 characters - Action label: max 50 characters 3. Service Role Support: Added mobile module to serviceRoleModules in client.ts to enable `base44.asServiceRole.mobile` for server-side bulk notifications 4. Test Coverage: Created comprehensive unit tests (mobile.test.ts) with 15 test cases covering: - Basic notification sending - Parameter validation (all character limits) - Error handling (API errors, 404s, partial failures) - Channel selection - Metadata and HTML content handling All tests pass (127/127) and build succeeds without errors. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
|
Claude finished @gdauber1's task —— View job 🔍 Code Review CompleteReview Checklist:
Overall AssessmentThis is an excellent implementation of the mobile module for the Base44 SDK. The code is clean, well-structured, and follows SDK conventions. I'm particularly impressed that my previous review feedback has been addressed comprehensively. ✅ Code Quality and Best PracticesStrengths:
Improvements from Previous Review:
🛡️ Security Considerations
🚀 Performance Considerations
🧪 Test Coverage - Excellent!The test suite (270 lines) is comprehensive and covers:
📚 Documentation and ExamplesExcellent documentation:
Minor Suggestions
SummaryThis PR is production-ready. The implementation is solid, follows best practices, and addresses all concerns from the previous review. The addition of comprehensive tests and proper service role support makes this a robust feature addition to the SDK. Great work on implementing the feedback and creating a well-documented, thoroughly tested mobile module! 🎉 |
Summary
Adds mobile native capabilities to the Base44 SDK, enabling LLM-generated apps to send push notifications to users via
base44.mobile.sendNotification().This PR implements the SDK side of mobile native features, complementing the backend mobile API.
Changes
SDK Mobile Module
mobilemodule withsendNotification()methodDocumentation
Examples
examples/mobile-notifications.tswith 10 practical examplesUsage
```typescript
import { base44 } from "@/api/base44Client";
// Send mobile push notification
await base44.mobile.sendNotification({
userId: 'user_123',
title: 'New Message!',
content: 'You have a new message from John',
actionLabel: 'View Message',
actionUrl: '/messages/456',
channels: ['mobile_push']
});
```
Files Changed
Features
Testing
The SDK compiles successfully:
```bash
npm run build # ✅ Passes
```
Examples
See
examples/mobile-notifications.tsfor comprehensive usage examples including:Documentation
Updated README.md with complete mobile features documentation including:
Co-Authored-By: Claude Sonnet 4.5 [email protected]