# Proper way of using DataAccessHelper to fetch binary data

**URL:** https://discourse.vtk.org/t/proper-way-of-using-dataaccesshelper-to-fetch-binary-data/14036
**Category:** vtk.js
**Tags:** vtkjs
**Created:** [June 13, 2024, 10:38am UTC](https://discourse.vtk.org/t/proper-way-of-using-dataaccesshelper-to-fetch-binary-data/14036 "2024-06-13T10:38:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DontSeeSharp](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/3d9bf3/32.png) [@DontSeeSharp](https://discourse.vtk.org/u/DontSeeSharp)
#### Post date: [June 13, 2024, 10:38am UTC](https://discourse.vtk.org/t/proper-way-of-using-dataaccesshelper-to-fetch-binary-data/14036/1 "2024-06-13T10:38:08Z")

</div>

In order to access the data, I often see something similar in javascript code:

```auto
import vtkLiteHttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper';

const zipFileData = await vtkLiteHttpDataAccessHelper.fetchBinary(
    'https://data.kitware.com/api/v1/item/63c1c7f96d3fc641a02d7f27/download'
);

```

However, when I try to use it in a typescript project I get:

```auto
TS6133: vtkLiteHttpDataAccessHelper is declared but its value is never read.
TS2693: vtkLiteHttpDataAccessHelper only refers to a type, but is being used as a value here.

```

The only solution right now is to ignore the errors

```auto
import _vtkLiteHttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper';

// @ts-expect-error Expecting TS2693, but it will work 
const zipFileData = await _vtkLiteHttpDataAccessHelper.fetchBinary(
    'https://data.kitware.com/api/v1/item/63c1c7f96d3fc641a02d7f27/download'
);

```

Is there a good way to use the LiteHttpDataAccessHelper in a typescript project or perhaps there is some documenation I couldn’t find?

Would be happy to contribute to documentation, for example to Introduction section here [DataAccessHelper | vtk.js](https://kitware.github.io/vtk-js/api/IO_Core_DataAccessHelper.html) , if this gets resolved.

Maybe related to: [Models served from a servlet](https://discourse.vtk.org/t/models-served-from-a-servlet/5628)
