# TotalAPI and Componentator service boundaries

> Verify the disabled TotalAPI branch and Componentator local-cache reuse without making external service calls.

Framework: total5
Product: Total.js 5 (total5@0.0.19)
Language: en
Content-SHA256: 5524e132d24137a2f048bb67797b5f5cbee93beb1b855059c50d44c081d0e2d4
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: total5-installed@total5@0.0.19
Review: not-recorded

`TotalAPI(operation, data)` delegates to `API('TAPI', operation, data)`. The built-in driver sends requests to the regional endpoint selected by `CONF.$tapiurl`, using a configured token such as `CONF.secret_totalapi`. `.promise()` and `.callback()` use the same API builder as other drivers. With `$tapi:false`, operations other than the driver's special `check` operation fail locally with `totalapi_inactive`.

`COMPONENTATOR(name, components, removeprev=true, attrs='')` determines a public bundle filename, stores its URL in `REPO[name]` and fetches it from Componentator only when the file is absent. With `removeprev:true`, older matching files may be deleted. The `componentator` event receives the name/component metadata before the lookup. This function returns before its async filesystem/download work has finished; the repo URL alone is not proof of download success.

For locally vendored frontend assets, serving known files avoids dependence on remote bundle availability. For live TotalAPI/Componentator integration, separately verify your exact service, credentials, network behavior and returned content. These services are optional and are not dependencies needed to start a native Total.js application.

```text config
$tapi : false
```

```js controllers/remote.js
exports.install = function() {
	ROUTE('GET /disabled-api/', async function($) {
		try { await TotalAPI('forge-fixture-no-service', {}).promise(); $.json({ unexpected: true }); }
		catch (e) { $.json({ error: String(e) }); }
	});
	ROUTE('GET /cached-componentator/', function($) {
		var components = 'forge-local-fixture';
		var relative = 'ui-' + components.makeid() + '.min.js';
		F.Fs.writeFileSync(PATH.public(relative), '/* local fixture */');
		COMPONENTATOR('fixture', components, false);
		$.json({ url: REPO.fixture, expected: '/ui-' + components.makeid() + '.min.js' });
	});
};
```
