The main client for interacting with Modal’s cloud infrastructure
The ModalClient class is the primary entry point for all interactions with Modal’s cloud services. It provides access to all Modal resources through service properties.
Custom gRPC middleware for advanced observability. These are appended after Modal’s built-in middleware.
The Modal gRPC API is not considered a public API and can change without warning.
import { ModalClient } from "modal";// Use default credentials from environment or .modal.tomlconst modal = new ModalClient();// Or provide explicit credentialsconst modal = new ModalClient({ tokenId: "ak-...", tokenSecret: "as-...", environment: "staging",});