Skip to content

Get Pods with @inrupt solid client

juanmglzs edited this page Mar 5, 2023 · 1 revision

Imports

  • getPodUrlAll

We can know the webID with session.info.webId used in Login a user with @inrupt solid client authn browser Edit New page.

With the function getPodUrlAll(webId, options?): Promise<[UrlString]> we can discover the Pods an agent advertises for in their profile resources. Both the agent’s WebID and alternative profiles are fetched.

Since the returning value is a list, we can use the javascript foreach to iterate over it. An example will be: const mypods = await getPodUrlAll(webID, { fetch: fetch }); mypods.forEach((mypod) => {doSometing(mepod)});

Links of interest

Read/Write Structured Data