@sassoftware/vi-api
Version:
Types used in the SAS Visual Investigator API
41 lines (31 loc) • 1.37 kB
Markdown
# Visual Investigator API
The [SAS Visual Investigator](https://www.sas.com/en_us/software/intelligence-analytics-visual-investigator.html) API provides a set of components and service methods that enable developers to create customized solutions within the application.
## Getting Started
For documentation and examples please see our [Solution Extension GitHub](https://github.com/sassoftware/vi-solution-extensions).
### Installation
To use the API, install the NPM package [@sassoftware/vi-api](https://www.npmjs.com/package/@sassoftware/vi-api):
```bash
npm install @sassoftware/vi-api
```
### API
The SVI API is available through the JavaScript window object:
```javascript
window.sas.vi.metadata.getEntity("person");
```
### Typings
To complement the API, solution developers can download the API typings package.
Run the following command in your project:
```
npm install @sassoftware/vi-api
```
The types can be used to help with autocompletion of API spaces, methods, and expected return types.
```typescript
import { SviWindow } from "@sassoftware/vi-api";
import { StoredObjectDTO } from "@sassoftware/vi-api/svi-datahub";
const sviWindow = window as SviWindow;
sviWindow.sas.vi.metadata.getEntity("person").then((entity: StoredObjectDTO | undefined) => {
if (entity) {
console.log("Retrieved entity:", entity.label);
}
});
```