### Activate Application File from Command Line Source: https://context7.com/soft8soft/verge3d/llms.txt The `keymanager activate ` command combines key validation and file stamping in a single CLI operation. It writes the license token into the specified file and exits with `0` on success or `1` on failure. ```bash keymanager activate /var/www/my_app/v3d.js XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-ABCD ``` -------------------------------- ### keymanager activate Source: https://context7.com/soft8soft/verge3d/llms.txt Activates an application bundle with a purchased key using the command line interface. ```APIDOC ## keymanager activate ### Description Activates the application bundle located at `` with the provided license key ``. ### Method CLI command ### Endpoint N/A ### Parameters #### Path Parameters - **FILE** (string) - Required - Path to the application bundle file. - **KEY** (string) - Required - The purchased license key. ### Request Example ```bash keymanager activate ./build/v3d.js XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-ABCD ``` ### Response #### Success Response Indicates successful activation. #### Response Example ``` Activation succeeded — proceeding with deployment. ``` #### Error Response Indicates activation failure. #### Response Example ``` Activation failed — aborting deployment. ``` ``` -------------------------------- ### CLI: keymanager activate Source: https://context7.com/soft8soft/verge3d/llms.txt Activates a Verge3D application file from the command line by combining key validation and file stamping. It exits with code 0 on success and 1 on failure. ```APIDOC ## CLI: keymanager activate ### Description Combines key validation and file stamping in a single CLI call. Writes the license token into `` and exits with `0` on success or `1` on failure. ### Parameters #### Path Parameters - **FILE** (string) - Required - The path to the Verge3D application file to activate. - **KEY** (string) - Required - The license key to use for activation. ### Usage ```bash # Activate an application file with a license key keymanager activate /var/www/my_app/v3d.js XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-ABCD # Output: (Success message or error, exit 0 on success, 1 on failure) # Using Python directly python3 keymanager.py activate ./build/v3d.js XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-ABCD ``` ``` -------------------------------- ### Activate Verge3D Application Bundle with Key Source: https://context7.com/soft8soft/verge3d/llms.txt Use the keymanager CLI to activate an application bundle with a purchased license key. This is typically done during build or post-install steps. ```bash # Activate an application bundle with a purchased key keymanager activate ./build/v3d.js XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-ABCD ``` ```bash # Typical CI/CD pipeline usage KEY="$VERGE3D_LICENSE_KEY" FILE="./dist/v3d.js" if keymanager activate "$FILE" "$KEY"; then echo "Activation succeeded — proceeding with deployment." else echo "Activation failed — aborting deployment." && exit 1 fi ``` -------------------------------- ### Verify Activation Status of Application File (CLI) Source: https://context7.com/soft8soft/verge3d/llms.txt The `keymanager verify ` command checks if a Verge3D application file has an embedded license token. It prints `OK` and exits with `0` if activated, or `BAD` and exits with `1` if not activated. The Python equivalent is also shown. ```bash # Check if an app file has been activated keymanager verify /var/www/my_app/v3d.js # Output: OK (exit 0 — license token present) keymanager verify /var/www/unlicensed_app/v3d.js # Output: BAD (exit 1 — no valid license token) # Python equivalent python3 keymanager.py verify ./build/v3d.js ``` -------------------------------- ### CLI: keymanager verify Source: https://context7.com/soft8soft/verge3d/llms.txt Checks whether a Verge3D application file has already been activated with a license key. It exits with code 0 ('OK') if activated, and code 1 ('BAD') otherwise. ```APIDOC ## CLI: keymanager verify ### Description Reads a Verge3D application file and checks whether a non-placeholder license token is already embedded. Exits with `0` (prints `OK`) if activated, `1` (prints `BAD`) otherwise. ### Parameters #### Path Parameters - **FILE** (string) - Required - The path to the Verge3D application file (e.g., `v3d.js`). ### Usage ```bash # Check if an app file has been activated keymanager verify /var/www/my_app/v3d.js # Output: OK (exit 0 — license token present) keymanager verify /var/www/unlicensed_app/v3d.js # Output: BAD (exit 1 — no valid license token) # Python equivalent python3 keymanager.py verify ./build/v3d.js ``` ``` -------------------------------- ### activate(path, key, validate=True) Source: https://context7.com/soft8soft/verge3d/llms.txt Stamps a Verge3D license key into an application file at the specified path. It can optionally validate the key before writing and returns a boolean indicating success or failure. ```APIDOC ## activate(path, key, validate=True) ### Description Opens the file at `path`, locates the license placeholder pattern (a regex matching the `v3dKey` token block), and replaces it with a token derived from the first 10 characters of `key`. When the optional third argument is `True` (default), the key is validated with `check_key` before writing; pass `False` to bypass validation (used internally by `deactivate`). Returns `True` on success, `False` if validation fails. ### Parameters #### Path Parameters - **path** (string) - Required - The file path to the Verge3D application file (e.g., `v3d.js`). - **key** (string) - Required - The license key to activate. - **validate** (boolean) - Optional - Defaults to `True`. If `True`, the key is validated using `check_key` before activation. Set to `False` to bypass validation. ### Request Example ```python from keymanager import activate app_js_path = "/var/www/my_verge3d_app/v3d.js" license_key = "XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-ABCD" success = activate(app_js_path, license_key) if success: print("License activated successfully.") else: print("Activation failed: key is invalid.") # Skip key validation (internal use / testing) activate(app_js_path, license_key, validate=False) ``` ### Response #### Success Response (True) - Returns `True` if the license key was successfully stamped into the file. #### Failure Response (False) - Returns `False` if the key validation failed or if the file could not be modified. ``` -------------------------------- ### Activate License Key in Application File (Python) Source: https://context7.com/soft8soft/verge3d/llms.txt The `activate` function stamps a license key into a Verge3D application file. It replaces a specific placeholder with a token derived from the key. By default, it validates the key using `check_key` before writing. Set `validate=False` to bypass this check, which is typically used internally. ```python from keymanager import activate app_js_path = "/var/www/my_verge3d_app/v3d.js" license_key = "XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-ABCD" success = activate(app_js_path, license_key) if success: print("License activated successfully.") else: print("Activation failed: key is invalid.") # Skip key validation (internal use / testing) activate(app_js_path, license_key, validate=False) ``` -------------------------------- ### CLI: keymanager check-key Source: https://context7.com/soft8soft/verge3d/llms.txt Validates a license key from the command line. It exits with code 0 (prints 'OK') if the key is valid, and code 1 (prints 'BAD') if invalid. ```APIDOC ## CLI: keymanager check-key ### Description Validates a license key and exits with code `0` (prints `OK`) if valid, or exit code `1` (prints `BAD`) if invalid. The sub-command accepts both `check-key` and `checkkey` spellings. ### Parameters #### Path Parameters - **KEY** (string) - Required - The license key to validate. ### Usage ```bash # Install via npm (makes the keymanager command available) npm install -g verge3d # Validate a key keymanager check-key XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-ABCD # Output: OK (exit 0) keymanager check-key BADKEY # Output: BAD (exit 1) # Use Python directly if not installed globally python3 keymanager.py check-key XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-ABCD ``` ``` -------------------------------- ### Verge3D ES Module Import Source: https://context7.com/soft8soft/verge3d/llms.txt Imports and initializes the Verge3D engine as an ES module in web projects. ```APIDOC ## import * as v3d from 'verge3d' ### Description Imports the Verge3D engine as an ES module, allowing for programmatic initialization and scene loading in web applications. ### Method JavaScript Module Import ### Endpoint N/A ### Parameters None directly for import, but the `App` constructor takes parameters. ### Request Example ```javascript // ES module (recommended) import * as v3d from 'verge3d'; // Initialize the Verge3D application const app = new v3d.App('my-canvas-id', null, { antialias: true, alpha: false, }); app.loadScene('MyScene.gltf', () => { app.enableControls(); console.log('Scene loaded, Verge3D is running.'); }); ``` ### Response #### Success Response Verge3D application is initialized and running. #### Response Example ``` Scene loaded, Verge3D is running. ``` ``` -------------------------------- ### check_key(key) / checkKey(key) Source: https://context7.com/soft8soft/verge3d/llms.txt Validates a Verge3D license key by checking its length and checksum. Both function names are aliases for the same underlying validation logic. ```APIDOC ## check_key(key) / checkKey(key) ### Description Validates a Verge3D license key by verifying its total length (54 characters) and confirming that the last 4 hex characters match a checksum computed from the preceding characters (sum of ASCII values modulo 0xFFFF). Returns `True` if the key is structurally valid, `False` otherwise. Both names are aliases for the same underlying function. ### Parameters #### Path Parameters - **key** (string) - Required - The license key string to validate. ### Request Example ```python from keymanager import check_key, checkKey sample_key = "XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-ABCD" result = check_key(sample_key) print(result) assert check_key(sample_key) == checkKey(sample_key) print(check_key("SHORT-KEY")) print(check_key("")) ``` ### Response #### Success Response (True) - Returns `True` if the key is structurally valid. #### Failure Response (False) - Returns `False` if the key is structurally invalid (incorrect length or checksum). ### Response Example ``` True False False ``` ``` -------------------------------- ### Validate License Key from Command Line Source: https://context7.com/soft8soft/verge3d/llms.txt The `keymanager check-key` command validates a license key directly from the terminal. It exits with code `0` and prints `OK` for valid keys, and code `1` with `BAD` for invalid keys. Both `check-key` and `checkkey` spellings are accepted. ```bash # Install via npm (makes the keymanager command available) npm install -g verge3d # Validate a key keymanager check-key XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-ABCD # Output: OK (exit 0) keymanager check-key BADKEY # Output: BAD (exit 1) # Use Python directly if not installed globally python3 keymanager.py check-key XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-ABCD ``` -------------------------------- ### Import Verge3D as ES Module in JavaScript Source: https://context7.com/soft8soft/verge3d/llms.txt Import the Verge3D engine as an ES module in your web project for initialization and scene loading. Ensure the canvas element with the specified ID exists in your HTML. ```javascript // ES module (recommended) import * as v3d from 'verge3d'; // Initialize the Verge3D application const app = new v3d.App('my-canvas-id', null, { antialias: true, alpha: false, }); app.loadScene('MyScene.gltf', () => { app.enableControls(); console.log('Scene loaded, Verge3D is running.'); }); ``` -------------------------------- ### Validate License Key String (Python) Source: https://context7.com/soft8soft/verge3d/llms.txt Use `check_key` or `checkKey` to validate the structural integrity of a Verge3D license key. Both functions perform the same checks: length of 54 characters and a valid checksum in the last 4 hex digits. Malformed or short keys will return `False`. ```python import sys sys.path.insert(0, '/path/to/verge3d') from keymanager import check_key, checkKey # A correctly formatted key (54 chars, valid checksum in last 4 hex digits) sample_key = "XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-ABCD" # illustrative result = check_key(sample_key) print(result) # True if length == 54 and checksum matches, False otherwise # Both aliases behave identically assert check_key(sample_key) == checkKey(sample_key) # Short / malformed key print(check_key("SHORT-KEY")) # False print(check_key("")) # False ``` -------------------------------- ### Deactivate License Key from Application File (Python) Source: https://context7.com/soft8soft/verge3d/llms.txt Use `deactivate` to remove a license key from an application file. This function internally calls `activate` with a placeholder, resetting the license token to an unactivated state. It's useful for redistribution or resetting. ```python from keymanager import deactivate app_js_path = "/var/www/my_verge3d_app/v3d.js" deactivate(app_js_path) print("License removed from application file.") ``` -------------------------------- ### keymanager deactivate Source: https://context7.com/soft8soft/verge3d/llms.txt Deactivates a file from the command line, resetting the license token. ```APIDOC ## keymanager deactivate ### Description Resets the license token in the specified `` to an unactivated state from the command line. This is useful before redistributing the application bundle. ### Method CLI command ### Endpoint N/A ### Parameters #### Path Parameters - **FILE** (string) - Required - Path to the application bundle file. ### Request Example ```bash keymanager deactivate ./build/v3d.js ``` ### Response #### Success Response Indicates successful deactivation. #### Response Example ``` License removed successfully. ``` ``` -------------------------------- ### deactivate(path) Source: https://context7.com/soft8soft/verge3d/llms.txt Removes a license key from a Verge3D application file by resetting the license token to an unactivated state. This is useful for redistributing or resetting applications. ```APIDOC ## deactivate(path) ### Description Reverses `activate` by calling it internally with a placeholder key string, effectively resetting the license token in the target file to an unactivated state. Useful when redistributing or resetting an application. ### Parameters #### Path Parameters - **path** (string) - Required - The file path to the Verge3D application file (e.g., `v3d.js`). ### Request Example ```python from keymanager import deactivate app_js_path = "/var/www/my_verge3d_app/v3d.js" deactivate(app_js_path) print("License removed from application file.") ``` ### Response This function does not return a value but modifies the specified file in place. ``` -------------------------------- ### Deactivate Verge3D Application Bundle Source: https://context7.com/soft8soft/verge3d/llms.txt Use the keymanager CLI or Python script to deactivate a Verge3D application bundle, resetting the license token. This is useful before redistributing the bundle. ```bash # Remove license from a bundle before redistribution keymanager deactivate ./build/v3d.js ``` ```python # Python equivalent python3 keymanager.py deactivate ./build/v3d.js ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.