Startups get up to $50k in free compute credits.
April 30, 20254 minute read
Modal SDKs for JavaScript and Go (alpha)
author
Eric Zhang@ekzhang1
Founding Engineer

Here at Modal, we make it easy for developers to bring powerful, on-demand cloud infrastructure into their own stacks. Many of you have been asking for a way to use Modal from other languages, even reverse-engineering our APIs to do so!

Today, we’re excited to launch an alpha of our official Modal SDKs for JavaScript and Go.

With these new SDKs, you can now call deployed Modal Functions and create isolated sandboxes from any server-side JavaScript or Go code (e.g., your Node backend, from a Next.js server handler, or within a Go microservice) — all without leaving your language of choice.

What can you do with the SDK?

These new client libraries let you:

  • 🔁 Call deployed Modal Functions from anywhere — think image processing, LLM inference, audio transcription, and long-running batch jobs.
  • 🧪 Create and interact with sandboxes — isolated, secure VMs where you can:
    • Execute code generated by a language model
    • Run untrusted scripts in a controlled environment
    • Check out a Git repo and run tests, linters, or setup commands
    • Launch a container with arbitrary dependencies and run one-off jobs

However, they don’t support deploying Modal Functions — those still need to be written in Python!

⚠️ Note: Only a limited subset of Modal functionality is currently available. Functions can only be called with JSON-like or bytes data types. Also, advanced function calling modes like map() and spawn(), sandbox tunnels, and features like volumes and container lifecycle management are coming soon. Stay tuned.

How to get started

First, authenticate with Modal. You can either:

  • Run pip install modal && modal setup to log in via the CLI, or
  • Set your credentials as environment variables:
    export MODAL_TOKEN_ID=ak-YOUR_TOKEN_ID
    export MODAL_TOKEN_SECRET=as-YOUR_TOKEN_SECRET

Then, install the SDK for your language.

JavaScript (Node, Deno, Bun, etc.)

npm install modal

Go

go get -u github.com/modal-labs/libmodal/modal-go

Example: JavaScript SDK in action

1. Call a deployed Modal Function

import { Function_ } from "modal";

const echo = await Function_.lookup("my-deployed-app", "echo_string");

// Call the function with args.
let ret = await echo.remote(["Hello world!"]);
console.log(ret);

// Call the function with kwargs.
ret = await echo.remote([], { s: "Hello world!" });
console.log(ret);

2. Start a sandbox and run a command

import { App } from "modal";

const app = await App.lookup("libmodal-example", { createIfMissing: true });
const image = await app.imageFromRegistry("python:3.13-slim");

const sb = await app.createSandbox(image);
console.log("Started sandbox:", sb.sandboxId);

const p = sb.exec(["python", "-c", "print(3 + 4)"]);
await p.stdout.readText(); // => "7"
await p.wait(); // => exit code: 0

await sb.terminate();

These examples are just the beginning — the SDKs are designed to be lightweight, consistent, and easy to use from any JavaScript or Go codebase.

Why this matters

Modal is a great fit for compute-heavy tasks, dynamic workloads, and anything you don’t want to run on your own servers. Until now, accessing Modal meant writing Python. That’s no longer the case.

With the Modal SDKs for JavaScript and Go, you can:

  • Call cloud functions from your existing infra
  • Spin up secure, dynamic sandboxes from anywhere
  • Run ephemeral workloads without provisioning machines

…and integrate with Modal from your language of choice — all without learning a new stack.


Documentation and examples are available in the GitHub repository at modal-labs/libmodal.

Remember that this is an alpha release. We’re just getting started, so APIs and naming conventions are subject to change, and newer features may be missing or incomplete. We’ve been rigorously testing these new SDKs though, and we can easily run 10,000 sandboxes in either Go or JavaScript with no issues.

Got questions? Come hang out in our community Slack — we’d love to hear what you’re building. And keep an eye out: we’ll be announcing new features for these SDKs soon.

Modal CTA

Ship your first app in minutes.

Get Started

$30 / month free compute