0.1.4 • Published 2 years ago

vuforia-js v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vuforia-js

Promise based client for the Vuforia Web Services API

Features

  • Implements all the target-based features of the Vuforia Web Service API
  • 100% test coverage
  • Fully typed

Example

Add a target

import { Vuforia } from 'vuforia-js'

const vf = new Vuforia({
  serverAccessKey: 'your-access-key',
  serverSecretKey: 'your-secret-key';
})

vf.addTarget({
  name: 'targetName',
  width: 100,
  active_flag: false,
  image: 'base64-image-data',
  application_metadata: 'base64-string',
})
  .then(function (response) {
    // handle success
    console.log(response);
  })
  .catch(function (error) {
    // handle error
    console.log(error);
  })

Methods Available:

vf.addTarget({});

vf.deleteTarget('target-id');

vf.updateTarget('target-id', {});

vf.retrieveTarget('target-id');

vf.findDuplicates('target-id');

vf.targetSummary('target-id');

vf.databaseSummary();

Helpers:

A few helpers functions are provided to convert data to base64:

// encode a local image file to base64 for use with addTarget and updateTarget
Vuforia.utils.encodeFileBase64('/path-to-local-file/relative-to/process.cwd');

// encode text as base64 for use with application_metadata - e.g. stringified json:
Vuforia.utils.encodeTextBase64(JSON.stringify({ json: 'metadata' }));
0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago