This document outlines the API stability guarantees for react-native-sync-vault.
We follow Semantic Versioning:
- MAJOR (x.0.0): Breaking changes
- MINOR (x.y.0): New features, backward compatible
- PATCH (x.y.z): Bug fixes, backward compatible
These APIs are considered stable and will maintain backward compatibility within the same major version:
useOfflineQueue(baseUrlOrConfig?)- Main hook for queue managementuseQueueStatus()- Hook for queue statususePendingRequests(limit?)- Hook for pending requestsuseFailedRequests()- Hook for failed requests
queue.push(options)- Queue a requestqueue.getPendingRequests(limit?, offset?)- Get pending requestsqueue.getFailedRequests()- Get failed requestsqueue.sync()- Manually trigger sync
QueuePushOptions- Options for queuing requestsQueuedRequest- Queued request structureFailedRequest- Failed request structureSyncStatus- Sync status structureNetworkStatus- Network status typeConflictResolutionStrategy- Conflict resolution strategies
These APIs may change in future versions:
ApiInterceptor- Direct interceptor access (use viauseOfflineQueueconfig instead)NetworkMonitor- Direct network monitor access (use hooks instead)SyncEngine- Direct sync engine access (use hooks instead)ConflictResolver- Direct conflict resolver access (use viaqueue.pushoptions)
When APIs are deprecated:
- They will be marked with
@deprecatedJSDoc tags - Deprecation warnings will be logged in development
- Deprecated APIs will be removed in the next major version
- Migration guides will be provided
- Removing public APIs
- Changing function signatures (parameters, return types)
- Changing behavior in ways that break existing code
- Removing or changing TypeScript types
- Changing default values that affect behavior
- Adding new optional parameters
- Adding new methods/properties
- Performance improvements
- Bug fixes that correct unintended behavior
- Internal implementation changes
- Adding new types (as long as existing types remain)
When upgrading to a new major version:
- Check the CHANGELOG.md for breaking changes
- Review migration guide (if provided)
- Update your code according to the migration guide
- Test thoroughly before deploying
Minor and patch versions are backward compatible. You can upgrade safely, but:
- Review CHANGELOG.md for new features and bug fixes
- Test your application to ensure compatibility
- Take advantage of new features as needed
Experimental → Stable → Deprecated → Removed
↓ ↓ ↓ ↓
v0.x.x v1.0.0+ v2.0.0+ v3.0.0+
- APIs may change without notice
- Not recommended for production
- Feedback welcome
- APIs maintain backward compatibility
- Changes only in major versions
- Recommended for production
- APIs still work but will be removed
- Migration path provided
- Deprecation warnings in development
- APIs no longer available
- Must migrate to new APIs
- TypeScript types are considered part of the public API
- Type changes follow the same stability guarantees
- Breaking type changes only in major versions
Native module methods are considered internal implementation details:
- Direct access to native modules is not part of the public API
- Native module changes don't constitute breaking changes
- Use the JavaScript/TypeScript APIs instead
import { useOfflineQueue } from 'react-native-sync-vault';
const queue = useOfflineQueue('https://api.example.com');
await queue.push({
method: 'POST',
url: '/api/users',
data: { name: 'John' }
});import { ApiInterceptor } from 'react-native-sync-vault';
// Direct access - may change in future versions
const interceptor = new ApiInterceptor();// Old API - no longer available
const queue = useOfflineQueue({ baseUrl: '...', legacyMode: true });If you have concerns about API stability or suggestions for improvements:
- Open an issue with the
api-stabilitylabel - Discuss in GitHub Discussions
- Propose changes via Pull Request
All APIs introduced in v1.0.0 and v1.1.0 are considered stable, except where marked as experimental.