ドキュメント

​
​

Development

User Acquisition

Monetization

産業

Vivox Unreal SDK

Vivox Unreal SDK

このページは選択した言語では使用できません。
Vivox
​
​
Vivox Unreal SDK
  • Overview
  • Get started
  • Release notes
  • Developer guide
  • Tutorials
  • Reference
    • Vivox Core Unreal class model overview
    • Vivox Unreal conventions
    • Unreal API Reference Manual
    • Access Token Developer Guide
      • Access token terminology
      • Requests that require access tokens
      • Access token identifiers
      • Access token format
      • Access token examples
      • Generate a token on the client
      • Generate a token on a secure server
        • Example: C++
        • Example: C#
        • Example: Python
        • Example: JavaScript
      • Key update API
      • Access token error codes
    • Server to Server Web API Reference Guide
    • Third-party license information
  1. Vivox Unreal SDK documentation

Example: JavaScript

How to generate Vivox access tokens using JavaScript code.
読み終わるまでの所要時間 1 分
最終更新 8ヶ月前

The following code is an example of how to generate access tokens in JavaScript.
/** Vivox Token Generation Example - JavaScript** NOTE: There are multiple ways to handle SHA-256 in JavaScript* Stanford JS Crypto Library - https://crypto.stanford.edu/sjcl/ (used below)* Source - http://bitwiseshiftleft.github.io/sjcl/sjcl.js* SHA256 from NPM - https://www.npmjs.com/package/sha256**/function vxGenerateToken(key, payload) { // Header is static - base64url encoded {} var base64urlHeader = base64URLEncode("{}"); // Can also be defined as a constant "e30" // Encode payload var base64urlPayload = base64URLEncode(payload); // Join segments to prepare for signing var segments = [base64urlHeader, base64urlPayload]; var toSign = segments.join("."); // Sign token with key and SHA-256 var hmac = new sjcl.misc.hmac(sjcl.codec.utf8String.toBits(key), sjcl.hash.sha256); signature = sjcl.codec.base64.fromBits(hmac.encrypt(toSign)); var base64urlSigned = signature.replace(/\+/g, "-").replace(/\//g, "_").replace(/\=+$/, ""); segments.push(base64urlSigned); return segments.join(".");}function base64URLEncode(value) { return Base64.encode(value).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=+$/, "");}claims = { "iss": "issuer", "exp": 1559359105, "vxa": "join", "f": "sip:.username.@domain.vivox.com", "t": "sip:confctl-g-channelname@domain.vivox.com"};// Example usagevar token = vxGenerateToken("secret", claims);console.log(token);

Copyright © 2026 Unity Technologies
法規事項プライバシーポリシークッキーDocumentation Terms of Use私の個人情報を販売または共有しないプライバシーに関する選択 (クッキー設定)

"Unity" の名称、Unity のロゴ、およびその他の Unity の商標は、米国およびその他の国における Unity Technologies またはその関係会社の商標または登録商標です (詳しくはこちら)。その他の名称またはブランドは該当する所有者の商標です。

一部のページは利便性向上のため機械翻訳を使用しており、内容に不正確な表現が含まれる場合があります。内容に齟齬または不一致が生じた場合は、英語版を正本とします。


    このページの問題を報告する