Call Smartfox server in Javascript

Hello all!
I have a problem in writing a script that sends a request to an extension of SmartFox server. I’ve already did it in C# but now i need the same thing in Javascript. I searched everywhere but i didn’t find anything, can someone help me?
I need a sample code like this, but in Javascript:

using UnityEngine;
using System.Collections;
using SmartFoxClientAPI;
using SmartFoxClientAPI.Data;

public class IdolController: MonoBehaviour {
	
	public int id;
	private int level=0;
	private int treshold=200;
	public Texture[] textures=new Texture[0];
	
	private static SmartFoxClient client;
	private int myId;

	
	// Use this for initialization
	void Start () {
		SmartFoxClient client = SmartFox.Connection;
                myId = client.myUserId;
		client = NetworkController.GetClient();
		client.SendXtMessage("idolExt", id.ToString(),null, SmartFoxClient.XTMSG_TYPE_STR);
		SFSEvent.onExtensionResponse += OnExtensionResponse;

		
	}

The SmartFox dll is written for C# so you need to convert it to work with Unityscript.