AsterhelmDeveloper DocumentationOpen Installation Centre
ASTERHELM DEPLOYMENT GUIDE

Install T.E.R.R.A. inside the system your team already uses.

Customers keep their existing dashboard. Their developer uploads a small token broker, pastes the widget snippet into an authenticated page and connects approved business data through TERRA Bridge.

Origin boundSubscription gatedServer secret protectedShort-lived browser tokens
T.E.R.R.A.
The installation ZIP contains no permanent secret.

Asterhelm reveals the deployment secret once in the authenticated Installation Centre. The customer pastes it into a private server configuration after downloading the kit.

BEFORE YOU START

What the customer needs

01

Existing login

Load TERRA only after the customer’s own user has signed in.

02

Server-side code

A backend endpoint keeps the permanent deployment secret out of JavaScript.

03

Exact origin

Use an exact HTTPS origin such as https://admin.company.com.

04

Approved data

Configure Atlas and read-only Bridge tools before expecting live answers.

STEP 1

Create the deployment

  1. Open Installation in Asterhelm.
  2. Select the project and Test environment.
  3. Enter a deployment name.
  4. Enter the exact website origin with no page path.
  5. Choose the public token endpoint path.
  6. Choose Plain PHP, Generic JavaScript or React + PHP.
  7. Create the deployment and copy the one-time secret.
https://dashboard.company.comCorrect origin
https://dashboard.company.com/admin/pageIncorrect — origins contain no paths
STEP 2

Download the protected kit

The ZIP is generated only after Asterhelm verifies the user, role, active entitlement, plan feature and environment. No public ZIP is stored.

asterhelm-terra-install/
├── public/
│   ├── terra-token.php
│   └── terra-test.php
├── private/
│   ├── terra-config.php.example
│   └── .htaccess
├── frontend/
│   ├── terra-embed.js
│   └── TerraEmbed.jsx
├── embed-snippet.html
├── installation-manifest.json
├── CHECKSUMS.txt
└── README-FIRST.txt
FilePurpose
terra-token.phpChecks the customer login and exchanges the deployment secret for a short-lived browser token.
terra-config.php.examplePrivate deployment ID, origin, session mapping and secret placeholder.
embed-snippet.htmlLoads the centrally hosted TERRA widget.
terra-test.phpTemporary logged-in test page. Delete it after testing.
CHECKSUMS.txtSHA-256 hashes for the generated files.
STEP 3

Configure the private secret

Copy terra-config.php.example to terra-config.php and paste the one-time secret.

<?php
return [
  'deployment_id' => 'deploy_...',
  'deployment_secret' => 'terra_deploy_test_...',
  'website_origin' => 'https://dashboard.company.com',
  'session_user_id_key' => 'user_id',
  'session_user_role_key' => 'role',
];

Recommended private location

/home/ACCOUNT/terra-private/terra-config.php

If it must remain under public_html, retain the supplied protected folder and .htaccess.

PLAIN PHP

Upload the token broker

Upload public/terra-token.php to the path chosen when the deployment was created.

/home/ACCOUNT/public_html/api/terra-token.php

The supplied file supports common PHP sessions. Change only the marked user-resolution section when required.

$userId = $_SESSION['user_id'] ?? null;
$userRole = $_SESSION['role'] ?? 'member';
FRONTEND

Paste TERRA into an authenticated page

<script src="https://api.asterhelm.com/embed/terra.js" defer></script>
<script>
window.addEventListener('DOMContentLoaded', function () {
  AsterhelmTerra.init({
    tokenEndpoint: '/api/terra-token.php'
  });
});
</script>

Asterhelm hosts terra.js centrally so fixes do not require every customer to replace the widget file.

REACT + PHP

Mount the generated component

Copy frontend/TerraEmbed.jsx into the React application and render it only within the authenticated layout.

import TerraEmbed from './components/TerraEmbed';

export default function AdminLayout() {
  return (<>
    <DashboardRoutes />
    <TerraEmbed />
  </>);
}

The deployment secret must never be placed in frontend environment variables that are bundled for the browser.

TEST CHECKLIST

Confirm the complete flow

TEST → LIVE

Create a separate Live deployment

  1. Switch the project to Live.
  2. Create a new Live deployment.
  3. Copy the new Live secret.
  4. Download a fresh Live kit.
  5. Update the private Live configuration.
  6. Run the Live evidence and origin checks.
Trials cannot use Live deployments.

A Live installation requires an active paid subscription.

SECURITY MODEL

How Asterhelm prevents kit sharing

Customer loginExisting authenticated employee
Token brokerSecret stays server-side
AsterhelmSubscription and origin verified
Browser tokenShort-lived and origin bound

Copied to another company

If a kit for https://cvbright.com is copied to https://anothercompany.com, Asterhelm returns:

{
  "ok": false,
  "error": {
    "code": "deployment_origin_mismatch",
    "message": "This TERRA deployment is not authorised for this website."
  }
}

Five origin mismatches within ten minutes temporarily block the deployment for fifteen minutes and create Audit Log events.

SUBSCRIPTION RULES

What happens when access changes

StatusKit downloadToken issuance
InternalTest and LiveAllowed
TrialingTest onlyTest only
ActiveWithin plan limitsAllowed
Past dueBlockedBlocked
CancelledBlockedBlocked
SuspendedBlockedBlocked

Previously downloaded files remain on the customer server, but they cannot obtain valid tokens after entitlement access stops.

TROUBLESHOOTING

Common installation errors

terra_config_missing

The token broker cannot locate terra-config.php.

customer_login_required

The customer session does not contain the configured user key.

deployment_secret_missing

The one-time secret was not pasted into the private config.

deployment_origin_mismatch

The website differs from the origin registered in Asterhelm.

deployment_revoked

The deployment was revoked or its secret was rotated.

subscription_required

The organisation entitlement is not active.

live_deployment_requires_subscription

A trial attempted to use a Live deployment.

deployment_temporarily_blocked

Repeated origin mismatches triggered the automatic block.

T.E.R.R.A.
READY TO INSTALL

Create the deployment inside Asterhelm.

The Installation Centre generates the code, protects the secret and records every kit download, secret rotation and origin mismatch.

Open Installation Centre