JavaScript client library for the SVRF API
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.swagger-codegen Generated library Jun 12, 2018
docs Added 3d media support Oct 23, 2018
src Added 3d media support Oct 23, 2018
test Added 3d media support Oct 23, 2018
.swagger-codegen-ignore Generated library Jun 12, 2018
.travis.yml Generated library Jun 12, 2018
LICENSE.md Made method names more readable Jun 20, 2018
README.md Added 3d media support Oct 23, 2018
git_push.sh Generated library Jun 12, 2018
mocha.opts Generated library Jun 12, 2018
package.json Added 3d media support Oct 23, 2018

README.md

svrf-client - the JavaScript client library for the SVRF API

For more information, please visit https://github.com/svrf/svrf-api

Getting Started

SVRF's API allows you to supercharge your project or app with the first and largest search engine for immersive experiences. We make it simple for any developer to incorporate highly immersive experiences with all kinds of applications: virtual reality, augmented reality, mixed reality, mobile, and web.

The SVRF API Documentation is available at https://developers.svrf.com.

Installation

For Node.js

npm

Install it via:

npm install svrf-client --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually use this library):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var SVRF = require('svrf-client');

var api = new SVRF.AuthenticateApi()

var body = new SVRF.Body(); // {Body} 

api.authenticate(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://api.svrf.com/v1

Class Method HTTP request Description
SVRF.AuthenticateApi authenticate POST /app/authenticate Authenticate application
SVRF.MediaApi getById GET /vr/{id} Media by ID Endpoint
SVRF.MediaApi getTrending GET /vr/trending Trending Endpoint
SVRF.MediaApi search GET /vr/search Search Endpoint

Documentation for Models

Documentation for Authorization

XAppToken

  • Type: API key
  • API key parameter name: x-app-token
  • Location: HTTP header