2.0.0 • Published 2 years ago
@zerapix/pixydocs-sdk v2.0.0
Pixydocs Javascript SDK
This SDK is meant to be used in the browser to simplify the integration of Pixydocs.
Example
import pixydocs from '@zerapix/pixydocs-sdk'
pixydocs.config.projectId = '<project-id>'
pixydocs.config.orgId = '<root-org-id>'
pixydocs.uploadDocument({
// file selected by user via a file input
file,
// Fires when the document is created and processing is starting
// documentData includes standard metadata, such as the document name and ID,
// but does not include OCR or labeling values.
onDocumentCreated: (documentData) => {},
// Fires when the document is done processing.
// documentData includes all discovered values from the document.
onDocumentProcessed: (documentData) => {},
})Local Development
To try this locally, first install serve globally with this command:
npm i -g serveThen build the package:
yarn buildMake the package available as a global package.
yarn linkNavigate into the test app.
cd test-appInstall dependencies for the test app.
yarn installLink the package.
yarn link @zerapix/pixydocs-sdkRun the test app.
yarn start