tl:dr: There is a new library to manage
address books & contacts in Solid Pods. Please try it and give feedback.
Hi all,
as part of the solid-data-modules initiative I have built a library that is meant to make it easier for developers to handle address books and contacts in Solid Pods.
- find address books in a Pod
- create and read address books
- create, read and update contacts
- organize contacts into groups
- …
You can do all this through a simple interface, without having to struggle with the details of the (yet to be) contacts client-to-client specification.
The library is interoperable with the address books from SolidOS.
What you can do with the library ![:bulb: :bulb:]()
- Build your own solid contacts manager app
- Easily integrate contacts to whatever app your are building, while focussing on the actual domain of your app
Quick start ![:rocket: :rocket:]()
The library currently comes in the “flavor” of rdflib, but you do not need to know anything about rdflib to use it.
npm install @solid-data-modules/contacts-rdflib rdflib
import {Fetcher, graph, UpdateManager} from "rdflib";
import ContactsModuleRdfLib, { ContactsModule } from "@solid-data-module/contacts-rdflib";
// 1️⃣ create rdflib store, fetcher and updater as usual
const store = graph();
const fetcher = new Fetcher(
store,
// 💡 pass an authenticated fetch
// to be able to access private resources*
/* fetch: authenticatedFetch */
);
const updater = new UpdateManager(store);
// 2️⃣ create the contacts module
const module: ContactsModule = new ContactsModuleRdfLib({store, fetcher, updater});
// 3️⃣ use the module to interact with address books and contacts
const uri = await contacts.createAddressBook({
container: "https://pod.example/alice/",
name: "new address book"
})
const contactUri = await contacts.createNewContact({
addressBookUri: uri,
contact: {
name: "Maurice Moss",
email: "maurice.moss@reynholm-industries.example",
phone: "0118-999-881-99-9119-725-3"
},
});
const addressBook = await contacts.readAddressBook(uri)
console.log(addressBook)
Request for Feedback ![:heart: :heart:]()
Any feedback is very welcome, even if you do not plan to use the library:
- What features are you missing?
- What is confusing?
- What is valuable?
- What needs to be added for your use cases?
- …
Links
- npm: @solid-data-modules/contacts-rdflib - npm
- source: data-modules/contacts at main · solid-contrib/data-modules · GitHub
- API docs: ContactsModule | @solid-data-modules/contacts-rdflib
11 posts - 4 participants