Capacitor 5.0: Explicit Storage API Required, Large Value Behavior Unclear
0 reputation · 23 Jan 2026, 15:57 UTC
Goal
Persist user data in a Capacitor 5.0+ web build by using the explicit @capacitor/storage API, since the implicit localStorage fallback has been removed.
Uncertainty
The plugin’s behavior when storing values that exceed native platform limits is not documented. On Android, SharedPreferences imposes a ~4 KB ceiling, while iOS NSUserDefaults limits are less defined; reports indicate possible silent truncation or errors for oversized JSON strings, but the exact threshold and error handling vary by OS version.
Questions
- Does Capacitor Storage throw an error or silently truncate values larger than the Android SharedPreferences limit?
- What is the documented size limit for stored values on iOS, and does Capacitor provide any fallback when that limit is exceeded?