I would like to use the dataview API in my own plugin

Things I have tried

  1. include following line on top
    import { getAPI } from "obsidian-dataview";
    => gives following message:
    Module '"obsidian-dataview"' has no exported member 'getAPI'.ts(2305)

I have installed obsidian-dataview via
npm install -D obsidian-dataview

This is the recommended way according to Developing Against Dataview - Dataview. I am very much a newbie in Typescript development and plugin development. Can anyone tell me how to get a step further please. If you need more information

More background: i basically only added this one line to the basic example plugin provided from obsidian side. It works well with out the one line, but is broken when including the import.

What I’m trying to do

I have written a javascript that I currently use with customJS plugin to execute a lot of dataview operations and format the output. Right now it gets to a size where it is not easy to handle it this way anymore and I feel refactoring it into a plugin might give me more options to structure it, test it and include existing code.

Still I would like to use the dataview api, so I can more easily migrate from my existing approach.

I could now resolve the issue with the help of a friend. still it is strange and I will raise an issue with dataview plugin. I hade to execute
npm install [email protected]
because standard install would just get me version 0.4.15 for some reason.
Anyway issue iss resoled.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.