Socket
Socket
Sign inDemoInstall

@banuba/webar

Package Overview
Dependencies
14
Maintainers
6
Versions
123
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @banuba/webar

Banuba WebAR SDK


Version published
Maintainers
6
Created

Readme

Source

Banuba WebAR SDK

@banuba/webar - Banuba SDK for web.

Check out the Banuba WebAR overview to learn the basics.

Installation

CDN

Via <script> tag:

<!-- Exposes BanubaSDK variable on window -->
<script src="https://cdn.jsdelivr.net/npm/@banuba/webar/dist/BanubaSDK.browser.js"></script>
<script>
  const { Webcam, Player, Dom } = BanubaSDK

  Player.create({
    clientToken: "PUT YOUR CLIENT TOKEN HERE",
  }).then((player) => {
    player.use(new Webcam())

    Dom.render(player, "body")
  })
</script>

Via <script type="module"> tag:

<script type="module">
  import {
    Webcam,
    Player,
    Dom,
  } from "https://cdn.jsdelivr.net/npm/@banuba/webar/dist/BanubaSDK.browser.esm.js"

  Player.create({
    clientToken: "PUT YOUR CLIENT TOKEN HERE",
  }).then((player) => {
    player.use(new Webcam())

    Dom.render(player, "body")
  })
</script>

NPM

npm i --save @banuba/webar
import { Webcam, Player, Dom } from "@banuba/webar"
import wasm from "@banuba/webar/BanubaSDK.wasm"
import simd from "@banuba/webar/BanubaSDK.simd.wasm"
import data from "@banuba/webar/BanubaSDK.data"

Player.create({
  clientToken: "PUT YOUR CLIENT TOKEN HERE",
  locateFile: {
    "BanubaSDK.wasm": wasm,
    "BanubaSDK.simd.wasm": simd,
    "BanubaSDK.data": data,
  },
}).then((player) => {
  player.use(new Webcam())

  Dom.render(player, "body")
})

Check out the Bundlers section of the Integrations guides.

Obtaining Banuba Client token

Banuba Client token is required to get Banuba SDK Web AR working.

To receive a new trial client token please fill in the form on banuba.com website, or contact us via info@banuba.com.

Keywords

FAQs

Last updated on 30 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc