Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aframe-uploadcare-component

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aframe-uploadcare-component

A Uploadcare component for A-Frame.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

aframe-uploadcare-component

A Uploadcare component for A-Frame.

For A-Frame.

API

PropertyDescriptionDefault Value
publicKeyYou uploadcare's public key

Functions

  • upload(value, contentType)
  • download(fileId, callback, binary)

Events

  • Upload
  • uploadcare-upload-started: Upload started.
  • uploadcare-upload-completed Upload completed succesfully:
    • url: Uploadcare CDN url of the uploaded resource.
    • fileInfo: Uploadcare fileInfo object.
  • uploadcare-upload-error: Something went wrong when uploading.
  • uploadcare-upload-progress, {progress: uploadInfo.progress, uploadInfo: uploadInfo})

Installation

Browser

Install and use by directly including the browser files:

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
  <script src="https://unpkg.com/aframe-uploadcare-component/dist/aframe-uploadcare-component.min.js"></script>
</head>

<body>
  <a-scene uploadcare="publicKey: asdf-1234-zxcv">
  </a-scene>
</body>
npm

Install via npm:

npm install aframe-uploadcare-component

Then require and use.

require('aframe');
require('aframe-uploadcare-component');

Examples

Upload a JSON
  var sceneEl = document.querySelector('a-scene');
  sceneEl.addEventListener('uploadcare-upload-completed', function (url) { alert('Uploaded: ' + url);});
  sceneEl.upload(jsonObject, 'application/json');
Download a JSON
  var sceneEl = document.querySelector('a-scene');
  sceneEl.download(url, function (data) {
    console.log('Loaded data', data);
  });

Keywords

FAQs

Package last updated on 21 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc