1.1.1 • Published 3 years ago

@stax.ai/document-viewer v1.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

README

This library includes various React components that ease the integraton of Stax.ai into your React projects. This is an open source library created and maintained by Stax.ai, Inc..

Components

This library includes the following components:

  • Document Viewer: pass in a Stax.ai document object (with presigned URLs) and view, scroll, and search through the document.

Installation

npm i @stax.ai/document-viewer

Usage

Document Viewer

The DocumentViewer component is only a front-end library to display and navigate a document. It does not retrieve the document from Stax.ai. Use the Stax.ai API to fetch the document, preferably from a secured API/backend so you don't have to expose your Stax.ai API key to your React app.

In your API:

const headers = {
    'Email': 'your@email.com',
    'Authorization': 'Bearer {TOKEN}'
};

const docId = '{DOCUMENT ID}';

const res = await axios.get(`https://api.stax.ai/document/get?docId=${docId}&presigned=true`, { headers });

const doc = res.data.doc; // This is the document object.

Note

axios is used as an example, however is not needed.

On your React on:

import DocumentViewer from '@stax.ai/stax-react';

function MyDocumentContainer(props) {
    // Let's say the document object is passed in as props.doc
    return <DocumentViewer doc={props.doc} />;
};
1.1.1

3 years ago

1.1.0

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago