Sandbox Limitations
To ensure platform stability, security, and consistent performance, EndpointX executes your code inside a highly restricted sandbox. This isolated environment intentionally limits the execution scope and resource consumption of your endpoints.
Understanding these boundaries is critical for designing efficient and reliable mock APIs.
Pure JavaScript Environment
You do not have access to any APIs or global objects added by the Node.js runtime or standard browser environments.
What is NOT available:
- Node.js Core: No
fetch,fs,path,crypto,os,http, orchild_process. - Browser APIs: No
window,document,DOM,localStorage, ornavigator. - Module Systems: No
importstatements orrequire()calls. You cannot install or use external npm packages. - Timers: No
setTimeout,setInterval,setImmediate, orclearTimeout. - And ...
Instead of using fetch, you can use axios to make HTTP requests inside your endpoint code. Axios is already available in the sandbox environment, so you can use it directly without installing any packages.
You are restricted entirely to standard JavaScript syntax (arrays, objects, loops, standard math/string manipulation) and the specific global objects injected by EndpointX.
See the related docs for the exact list of available injected globals like db, axios(), and signJWT() and ...
Working Within Limitations
EndpointX runs your endpoint code inside a secure isolated environment with execution and resource limitations.
Memory Limits
Each endpoint has a 128MB memory limit.
Avoid loading very large datasets, creating unnecessary copies of large objects, or returning the entire database in a single request.
Fetch Limitations
External requests made through the runtime axios API have an 8-second timeout limit.
If an external service takes longer than this limit, the request will fail. Handle possible network failures and avoid depending on slow external services.
Restricted JavaScript Features
For security reasons, some JavaScript features are not available inside EndpointX runtime.
You cannot use:
- Import statements
- Node.js modules
- File system access
- Process management
- Timers such as
setTimeoutandsetInterval - External packages
- And ...
Only the provided runtime APIs are available.
JSON Database Size
Each project's JSON database has a maximum size limit of 2MB.
To keep your database efficient:
- Avoid storing unnecessary data.
- Store only the required fields.
- Use pagination when working with large collections.
- Avoid returning the entire database in a single request.
Environment Variables
Each project can have a maximum of 30 environment variable records.
Use environment variables only for configuration values and secrets that your endpoints need.
Request Logs
EndpointX stores the latest 30 request logs for each project.
Older logs are automatically removed when new requests are received.
Request logs are useful for debugging and monitoring your endpoints during development.
Authentication
Every request to your endpoint must include your EndpointX token in the request headers.
endpoint-x: TOKEN