To request access to the OneJS private repo, please message Singtaa on Discord with your Invoice # and Github username. Our Discord is also a great place to chat and search for answers already asked by the community.

UnityWebRequest Example

Under ScriptEngine's INTEROP section, make sure to set the Objects mapping for "uwr".

// Javascript
var uwr = require("uwr") // This is the exposed UnityWebRequestUsage object

uwr.GetTextFromUri("", (text) => {
// C#
using System;
using System.Collections;
using UnityEngine;
using UnityEngine.Networking;

public class UnityWebRequestUsage : MonoBehaviour {
    public void GetTextFromUri(string uri, Action<string> callback) {
        StartCoroutine(GetText(uri, callback));

    IEnumerator GetText(string uri, Action<string> callback) {
        using (UnityWebRequest request = UnityWebRequest.Get(uri)) {
            yield return request.Send();

            if (request.result == UnityWebRequest.Result.ConnectionError) { // Error
            } else { // Success