Skip to main content
The create() method provisions a brand-new sandbox container within Fermion’s secure cloud infrastructure. When invoked, it initializes a clean Linux environment, configures your session, and establishes a WebSocket connection for real-time communication. Depending on the options you pass, the sandbox can be either ephemeral (short-lived and automatically destroyed on disconnect) or persistent (saved for later use). You can also clone a Git repository during provisioning, making it easy to start from existing codebases or templates. The process typically completes within a few seconds, after which the sandbox is ready to accept commands, file operations, or server executions. The method returns a unique snippetId, which you can store and reuse to reconnect to the same environment later.

create(options)

Description: Creates and provisions a new sandbox container. This process includes:
  1. Creating a playground snippet
  2. Starting a session
  3. Waiting for container provisioning (polling with 500ms intervals)
  4. Establishing WebSocket connection
  5. Waiting for container server to be ready
  6. Optionally cloning a git repository
Parameters: Returns: Promise<{ playgroundSnippetId: string }> - Resolves with the playground snippet ID (save this to start another container with same file system later) Example: