Save key-value strings to the OS SharedPreferences to survive cache wipes and memory clears.
Save persistent key-value data directly to Android SharedPreferences and iOS UserDefaults. Unlike browser localStorage, this data survives WebView cache clears and app memory purges.
import nativine from 'nativine';
await nativine.storage.set('user_token', 'jwt_abc123');
Pass a key and an optional default value to return if the key does not exist:
import nativine from 'nativine';
const token = await nativine.storage.get('user_token', '');
import nativine from 'nativine';
await nativine.storage.clear();