Node.js library for communicating with 1Password and retrieving passwords.
Note: You may need to set the process title.
const onepass = require('onepass')();
// Configure creds if you have them
onepass.auth.credentials(creds);
// Otherwise generate new creds
creds = onepass.auth.generateCredentials();
onepass.auth.credentials(creds);
// Promise API
onepass.password('http://example.com')
.then(password => ...)
.catch(err => ...);
// Node callback API
onepass.password('http://example.com', (err, pass) => {
...
})
If you're using 1Password 5+, or you run into this screen:
This causes a problem for onepass
as it isn't a "trusted browser" per se.
In order to fix this issue, you need to do the following:
- Open up 1Password's preferences
- Find the
Advanced
settings tab. - Uncheck
Verify browser code signature
.
A big thank you Reuven V. Gonzales and his work on sudolikeaboss. onepass
is largely based on sudolikeaboss
.
Another big thank you to AgileBits for bringing us 1Password.