Skip to content
Hoody.com

Use these endpoints to inspect, verify, and install the npm modules available to a script running inside a container. The bundled list describes what is preinstalled in the container image, the check endpoint compares the modules required by a script against what is installed, and the install endpoint resolves and adds any missing modules on demand. The SDK types endpoint is a lookup aid for writing scripts: it inspects the installed hoody-sdk copy and returns the methods it exposes.

All requests target the container-scoped exec service. Hostname template: {projectId}-{containerId}-exec-1.{server}.containers.hoody.com.

Returns the set of npm modules that are preinstalled in the container image, along with a flag indicating whether every module listed is currently available in the node_modules tree.

This endpoint takes no parameters.

Terminal window
curl -X GET "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/dependencies/bundled" \
-H "Authorization: Bearer <token>"

Compares the modules required by a script (either supplied directly as a modules array, or inferred from the script code via require / import parsing) against the modules currently installed in the container. The response distinguishes installed packages, missing packages, and may include per-module diagnostic details.

This endpoint takes no parameters.

The body must match one of two shapes: provide code to scan script source for imports, or provide modules as an array of module specs to check. Supplying both fields is allowed, but at least one of the two must be present.

FieldTypeRequiredDescription
codestringYes (one of code or modules)Script source whose imports are checked. Used when modules is not given.
modulesarray of stringsYes (one of code or modules)Module specs to check (e.g. "lodash", "axios@1.2.3"). When omitted or null, the modules imported by code are checked.
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/dependencies/check" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"code": "const _ = require(\"lodash\"); const axios = require(\"axios\");",
"modules": ["lodash", "axios"]
}'

Resolves and installs the specified npm module(s) into the container’s node_modules directory. Pass either a single module spec (e.g. lodash, axios@1.2.3) or an array of specs to install multiple modules in sequence. Already-present modules are reported as already-installed unless force is set to true.

This endpoint takes no parameters.

FieldTypeRequiredDefaultDescription
modulesstring | array of stringsYesOne npm module spec (e.g. "lodash", "axios@1.2.3") or an array of specs. Array form installs every module in sequence.
forcebooleanNofalseWhen true, reinstall modules that are already present instead of reporting them as already-installed.
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/dependencies/install" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"modules": ["lodash", "axios@1.6.2"],
"force": false
}'

Look up hoody-sdk methods in the copy of the SDK that scripts load (the one in the scripts directory’s node_modules). This is a lookup aid for writing scripts, not a dependency check: it inspects the installed SDK and returns the methods it exposes, optionally filtered by kit, free-text query, or limited in count. Use kit to scope the result to a single client property (for example files, api, exec, sqlite), use q to find methods whose path, name, or summary contain every word, and use raw to also fetch the .d.ts source of the matched methods.

NameInTypeRequiredDescription
kitquerystringNoKit to list: a client property (files, api, exec, sqlite, …), or client for the client’s own methods (withContainer, login, …). Any letter case. An unknown kit is a 404 with details.kits.
qquerystringNoWords, all of which must appear in the method’s path, name or summary (any letter case).
limitqueryintegerNoMost methods to return, 1 to 100 (default 20). total counts every match.
rawquerystringNoWhen true, also return the .d.ts text of the files declaring the returned methods (dts, at most 256 KB). Needs kit or q. Accepted literal values: true, false, 1, 0 (default "false").
Terminal window
curl -X GET "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/sdk-types?kit=files&limit=20" \
-H "Authorization: Bearer <token>"