windingwind / zotero-plugin-toolkit

Toolkit for Zotero Plugin Developers.
https://www.npmjs.com/package/zotero-plugin-toolkit
MIT License
115 stars 13 forks source link

How can I access the metadata/file paths of all a users's saved files? #25

Closed ShreyJ1729 closed 1 year ago

ShreyJ1729 commented 1 year ago

New user of the library here. I was looking through the docs and couldn't find anything on this. How can I access a user's saved items? I'm building a tool that backs up data in a private cloud so I want to get a list of all the metadata of the users items and push them to my DB.

windingwind commented 1 year ago

The APIs of data: https://github.com/windingwind/zotero-types/blob/master/types/xpcom/data/items.d.ts

The source code of Zotero: https://github.com/zotero/zotero/blob/main/chrome/content/zotero/xpcom/data/items.js

ShreyJ1729 commented 1 year ago

Thanks! Quick second question - how can I access the logged in user's email address?

windingwind commented 1 year ago

Zotero.Prefs.get("sync.server.username") Please ask the user for permission before getting this sensitive information.