{"id":47320,"library":"cordova-plugin-secure-storage-echo","title":"Cordova Secure Storage Plugin (Echo Fork)","description":"A Cordova plugin for securely storing strings (credentials, tokens) using platform-native keychains: iOS Keychain (SAMKeychain), Android keystore (AES encryption with generated key), Windows Data Protection API. Forked from Crypho's plugin to maintain compatibility. Version 5.1.1 supports Android, iOS, and Windows (8.x/10/UWP). Uses a namespace-based API with callbacks (not Promises). Alternatives include cordova-plugin-secure-storage (original) and cordova-plugin-ios-keychain.","status":"active","version":"5.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/mibrito707/cordova-plugin-secure-storage-echo","tags":["javascript","cordova","security","encryption","storage","secure","ecosystem:cordova","cordova-android","cordova-ios"],"install":[{"cmd":"npm install cordova-plugin-secure-storage-echo","lang":"bash","label":"npm"},{"cmd":"yarn add cordova-plugin-secure-storage-echo","lang":"bash","label":"yarn"},{"cmd":"pnpm add cordova-plugin-secure-storage-echo","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Must be accessed via cordova.plugins.SecureStorage after deviceready. Not a module import – plugin is loaded globally by Cordova.","wrong":"var ss = new SecureStorage(successCb, errorCb, 'namespace');","symbol":"SecureStorage","correct":"var ss = new cordova.plugins.SecureStorage(successCb, errorCb, 'namespace');"},{"note":"set/get/remove take callback functions as first two arguments, then key/value. Forgetting callbacks causes undefined errors.","wrong":"ss.set('key', 'value');","symbol":"SecureStorage.set","correct":"ss.set(successCb, errorCb, 'key', 'value');"},{"note":"Returns void, not a Promise. Use callbacks. Does not support async/await without manual promisification.","wrong":"ss.get('key').then(...)","symbol":"SecureStorage.get","correct":"ss.get(successCb, errorCb, 'key');"}],"quickstart":{"code":"// Wait for Cordova to initialize\ndocument.addEventListener('deviceready', function() {\n  // Create a namespace (like 'my_app')\n  var ss = new cordova.plugins.SecureStorage(\n    function() { console.log('Storage ready'); },\n    function(err) { console.error('Error creating storage:', err); },\n    'my_app'\n  );\n\n  // Store a value\n  ss.set(\n    function(key) { console.log('Set ' + key); },\n    function(err) { console.error('Error setting:', err); },\n    'username',\n    'johndoe'\n  );\n\n  // Retrieve the value\n  ss.get(\n    function(value) { console.log('Got: ' + value); },\n    function(err) { console.error('Error getting:', err); },\n    'username'\n  );\n\n  // Remove the key\n  ss.remove(\n    function(key) { console.log('Removed ' + key); },\n    function(err) { console.error('Error removing:', err); },\n    'username'\n  );\n\n  // List all keys\n  ss.keys(\n    function(keys) { console.log('Keys: ' + keys.join(', ')); },\n    function(err) { console.error('Error listing keys:', err); }\n  );\n\n  // Clear all keys in the namespace\n  ss.clear(\n    function() { console.log('Cleared'); },\n    function(err) { console.error('Error clearing:', err); }\n  );\n}, false);","lang":"javascript","description":"Demonstrates creating a SecureStorage instance, setting, getting, removing, listing keys, and clearing all values."},"warnings":[{"fix":"Wrap all plugin calls inside document.addEventListener('deviceready', function() { ... })","message":"Must wait for deviceready event before accessing cordova.plugins.SecureStorage. Accessing too early results in undefined.","severity":"breaking","affected_versions":">=1.0"},{"fix":"Always provide both callback functions (even if empty). Example: new cordova.plugins.SecureStorage(function(){}, function(){}, 'ns')","message":"Constructor expects success and error callbacks as first two arguments. Omitting them or passing null will cause the plugin to fail silently.","severity":"breaking","affected_versions":">=1.0"},{"fix":"Always convert non-string data: JSON.stringify(value) for objects, String(num) for numbers, etc.","message":"Keys and values must be strings. Passing numbers, objects, or booleans without string conversion will cause unexpected behavior.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Set preference before first use. If changing, you may need to clear the app's keychain or uninstall/reinstall.","message":"iOS KeychainAccessibility preference must be set in config.xml before building. Changing it after initial storage may cause access issues on subsequent launches.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Test on Windows thoroughly. Consider using cordova-plugin-secure-storage-echo only for iOS/Android if Windows is critical.","message":"Windows platform support uses Data Protection API but may not be fully maintained in future versions. Check for Windows-specific bugs.","severity":"deprecated","affected_versions":">=5.0"}],"env_vars":null,"search_vec":"'5.1.1':44 '8':50 'ae':26 'altern':62 'android':24,46,86 'api':34,57 'base':56 'callback':59 'compat':42 'cordova':1,8,65,72,77,83,85,88 'cordova-android':84 'cordova-io':87 'cordova-plugin-ios-keychain':71 'cordova-plugin-secure-storag':64 'credenti':14 'crypho':37 'data':32 'echo':5 'ecosystem':82 'encrypt':27,79 'fork':6,35 'generat':29 'includ':63 'io':21,47,74,89 'javascript':76 'key':30 'keychain':20,22,75 'keystor':25 'maintain':41 'namespac':55 'namespace-bas':54 'nativ':19 'origin':69 'platform':18 'platform-n':17 'plugin':4,9,39,66,73 'promis':61 'protect':33 'samkeychain':23 'secur':2,11,67,78,81 'storag':3,68,80 'store':12 'string':13 'support':45 'token':15 'use':16,52 'version':43 'window':31,49 'x/10/uwp':51","created_at":"2026-06-07T16:50:55.556270+00:00","updated_at":"2026-06-07T16:50:55.556270+00:00","problems":[{"fix":"Move initialization inside deviceready listener.","cause":"Accessing cordova.plugins.SecureStorage before deviceready event fires.","error":"TypeError: Cannot read property 'SecureStorage' of undefined"},{"fix":"Run: cordova plugin add cordova-plugin-secure-storage-echo","cause":"Plugin not installed or not loaded properly. Missing cordova plugin add command.","error":"Error: SecureStorage is not defined"},{"fix":"Ensure all keys and values are strings. If persistent, uninstall/reinstall app or clear app data.","cause":"Android: Trying to set/get non-string data or corrupted storage.","error":"Java exception was raised during method invocation"},{"fix":"Verify that all arguments are valid strings. For optional null values, pass empty string '' instead.","cause":"iOS: Passing nil or non-string to a method that expects a string.","error":"NSInvalidArgumentException"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/mibrito707/cordova-plugin-secure-storage-echo#readme","github":"https://github.com/mibrito707/cordova-plugin-secure-storage-echo","docs":null,"changelog":null,"pypi":null,"npm":"cordova-plugin-secure-storage-echo","openapi_spec":null,"status_page":null,"smithery":null,"categories":["security","storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}