Get Started

Basics | Package Manager | Publishable API Keys

Browser

<head>
  <script src="https://aframe.io/releases/0.7.1/aframe.min.js"></script>
  <script src="https://dist.3d.io/3dio-js/1.2.x/3dio.min.js"></script>
</head>
<body>
  <script>
    io3d.utils.ui.message.success('Hello World')
  </script>
</body>

Using 3dio without A-Frame is also possible. This is particulary useful if you don't need to render a 3D view:

<script src="https://dist.3d.io/3dio-js/1.2.x/3dio.min.js"></script>
<script>
  io3d.utils.ui.message.success('Hello World')
</script>

Package Manager Support

We support Bower, Webpack, Require.js and similar. 3dio is packaged in UMD (Universal Module Definition) format so that it can be used as CommonJS or AMD module.

  1. Install library from npm npm install 3dio --save
  2. Use it your code base:
    var io3d = require('3dio')
    io3d.utils.ui.message.success('Hello World')
    

Using Publishable API Keys

For some extended functionality with subscription based quotas a publishable API key is required. The authentication docs provide a detailed overview of what exactly you can do with publishable API keys.

Specify your publishable API key in the 3dio script URL:

<script src="https://dist.3d.io/3dio-js/1.2.x/3dio.min.js?pk=YOUR_PUBLISHABLE_API_KEY"></script>

Alternatively you can set a publishable API key dynamically using the config method:

<script src="https://dist.3d.io/3dio-js/1.2.x/3dio.min.js"></script>
<script>
  io3d.config({
    publishableApiKey:'YOUR_PUBLISHABLE_API_KEY'
  })
</script>

Config is also the recommended method when using a package manager like Bower, Webpack, Require.js or similar:

var io3d = require('3dio')
io3d.config({
  publishableApiKey: 'YOUR_PUBLISHABLE_API_KEY'
})

Secret API Key

Please do not use secret API keys in browser environments. Doing so would expose it to everybody. Secret API keys should be kept secret and used only in secure environments. Expose your secret API key only to trusted 3rd parties.

Next Steps