Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including mtasa with all npm packages installed. Try it out:

var mtasa = require("mtasa")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

mtasa v0.1.3


Build Status Coverage Status MIT license

MTA:SA SDK for Node.js

Lightweight module to simplify integration of external apps with MTA:SA servers. Uses the standard HTTP call interface, which you can learn more about here.


npm install mtasa --save


Import the Client class:


import { Client } from "mtasa";


const Client = require('mtasa').Client;

Then create a new client instance and use it to make some remote calls:

// Setup a new client for local server
const mta = new Client("", 22005, "root", "pass");

// Perform calls using async/await:
(async () => {
    try {
        // Call some procedure
        const result = await mta.resources.test_resource.testProcedure("some param");

        // Call a procedure (the alternative verbose API)
        const verboseCallResult = await"test_resource", "testProcedure", "some param", 1234);
    } catch (err) {
        console.error(`Ooops! Something went wrong ${err}`);

// Without async/await, plain old Promises:
    .then((result) => {
    .catch((err) => {
        console.error(`Ooops! Something went wrong ${err}`);

For more information on how to expose your MTA server APIs (like the testProcedure function from test_resource resource) over the web interface, refer to Resource Web Access wiki page.


The source code has inline documentation, which is also included in typings (.d.ts) shipped with the module. This means that no matter if you write plain old JavaScript or TypeScript - as long as you use some decent editor with intellisense (like Visual Studio Code), you should get nice autocompletion and feedback with documentation. Just give it a try yourself - use one of the examples above, type new Client( at the very end and hit CTRL + Shift + Space if the popup didn't appear automatically already.

VSCode demo

You can also jump straight into the source code of the library and unit tests.

Project status

This library is totally usable but is perhaps still lacking some features, hence the 0.1.x version. I consider it stable for my own needs. Feel free to report bugs or feature requests here. PRs welcome too.




RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free