Vercel Sandbox SDK v1.9.0 adds file permission control to writeFiles API
File Permission Control Now Available
Vercel Sandbox SDK v1.9.0 introduces native support for setting file permissions directly when writing files to sandboxes. Previously, developers had to perform separate operations to set file permissions after creating files.
What Changed
The writeFiles API now accepts a mode property that allows you to specify Unix-style file permissions (octal notation) during file creation. This eliminates the need for an additional round-trip to execute chmod commands.
How to Use
Pass the mode property when writing files:
sandbox.writeFiles([{
path: 'run.sh',
content: '#!/bin/bash\necho "ready"',
mode: 0o755
}]);
This approach is particularly useful for:
- Creating executable scripts with proper permissions in one operation
- Managing access rights directly within the sandbox
- Reducing API calls and improving performance by combining file creation and permission setting
Getting Started
Update to Vercel Sandbox SDK v1.9.0 and refer to the documentation for complete API details.