Keychain Plugin


I requires to add “Keychain” plugin in the project.

After I add the plugin with the following command, and add the sample code, there is an error that says Cannot find variable “Keychain”

Command: cordova plugin add
Sample code:
$cordovaKeychain.setForKey(key, serviceName, value).then(function(value) {
}, function (err) {


0 702526 error Error: Can’t find variable: Keychain

Anyone has similar experience can advise?

Appreciate a lot!


Anyone has idea about this?


// Get a reference to the plugin first
var kc = new Keychain();

kc.setForKey(successCallback, failureCallback, ‘key’, ‘servicename’, ‘value’);


Thank you sir.

I already add the cordova plugin
And the error happens in ng-cordova.js

Do you suggest me to use the plugin directly instead of using ng-cordova as a wrapper?


Any developer from ionic can help to take a look? Appreciate a lot!!