Skip to content

Tempo Plugin Setup Guide

This guide explains how to install and activate premium Tempo plugins.

1. Tempo License Registry

🔑 ACTION REQUIRED: Generate Your License Key

To use any premium plugins, you must first generate a cryptographic license key (JWT).

Tempo License Registry
👉 Go to the Tempo License Registry 👈
Manage your subscriptions and retrieve your license key.

2. Installation

All premium plugins are distributed as public scoped packages on the standard npm registry (npmjs.com). This means no special token configuration or registry overrides are required in your .npmrc. You can install them directly using your preferred package manager:

bash
npm install @magmacomputing/tempo-plugin-astro

3. Activation

Although the packages are publicly installable, they require your valid license key at runtime. If no valid license key is detected, the premium features will fail-safe to undefined.

Once you have your key from the registry, you can activate it using any of the following discovery methods:

Set the TEMPO_LICENSE_KEY environment variable in your run environment:

bash
export TEMPO_LICENSE_KEY="eyJhbGciOiJSUzI1NiJ9..."

Then in your application, you can simply import Tempo and the plugin via side-effect. Because the license key is automatically discovered from the environment variable, no manual initialization is required, and the side-effect import registers the plugin automatically:

javascript
import { Tempo } from '@magmacomputing/tempo';
import '@magmacomputing/tempo-plugin-astro'; // Automatically registers AstroTerm

const t = new Tempo();
console.log(t.term.astro); // Unlocked and ready!

Pass the key explicitly when initializing Tempo. Since static imports are hoisted, calling Tempo.init() after a side-effect import will clear any registered terms. To avoid hoisting issues, you can either pass the plugins directly into the plugins configuration array (cleanest and recommended), or call Tempo.extend() explicitly after initialization:

javascript
import { Tempo } from '@magmacomputing/tempo';
import { AstroTerm } from '@magmacomputing/tempo-plugin-astro';

Tempo.init({
  license: 'eyJhbGciOiJSUzI1NiJ9...',
  plugins: [AstroTerm]
});

Option 2: Explicit Extension

javascript
import { Tempo } from '@magmacomputing/tempo';
import { AstroTerm } from '@magmacomputing/tempo-plugin-astro';

// 1. Initialize core Tempo with your license
Tempo.init({
  license: 'eyJhbGciOiJSUzI1NiJ9...'
});

// 2. Register the plugin
Tempo.extend(AstroTerm);

Method C: Global Context (Fallback for specific bundlers/environments)

Method C is a browser-native variation of Method A. While Method A targets the process-level environment (process.env) available in Node/SSR contexts, Method C sets the key on the JavaScript globalThis object (which maps to window in browsers), enabling the same auto-discovery behaviour.

Use this method in the following scenarios:

1. Direct HTML Script Tags (No Bundler)

If you are loading Tempo directly from a CDN or local file using <script> tags, set the key in an inline script before loading the Tempo bundle:

html
<script>
  window.TEMPO_LICENSE_KEY = "eyJhbGciOiJSUzI1NiJ9...";
</script>
<script type="module" src="/js/tempo.bundle.js"></script>
<script type="module" src="/js/tempo-plugin-astro.js"></script>

2. Frontend Bundlers without process.env Polyfills

Modern browser bundlers (e.g., Vite) do not inject Node's process object by default. If you prefer to avoid configuring build-time env replacements or dotenv plugins, assign the key to globalThis in your entry file before importing Tempo:

javascript
// entry.js — must run before any Tempo import
globalThis.TEMPO_LICENSE_KEY = import.meta.env.VITE_TEMPO_LICENSE_KEY;

// Now safe to import
import { Tempo } from '@magmacomputing/tempo';
import '@magmacomputing/tempo-plugin-astro';

3. Micro-frontends / Shared Global Space

In architectures where multiple independently-bundled applications share a single browser tab, set the key once in the host container. All dynamically-loaded sub-applications will then auto-discover it without needing individual configuration:

javascript
// host-container.js
globalThis.TEMPO_LICENSE_KEY = 'eyJhbGciOiJSUzI1NiJ9...';

// sub-apps loaded later will automatically run in licensed mode

4. Network Requests & Offline Behavior

To verify license validity and prevent abuse, Tempo's licensing engine performs background synchronization with our revocation registry:

  • Outbound Request: When a license key is active, Tempo asynchronously fetches a cryptographically signed revocation list (JWS).
  • Endpoint: https://registry.magmacomputing.com.au/tempo/v1/revoked.jws (useful for configuring Content Security Policies (CSP) or egress firewall rules).
  • Frequency: The revocation check occurs once every 7 days. The last-checked state is cached to avoid redundant network traffic on subsequent startups.
  • Offline Resilience (Fail-Open): If your application is offline, behind a strict firewall, or the registry server is temporarily unreachable, the validation fails open. Tempo logs a warning in the console but continues to grant access to premium features (relying on the local cryptographic expiration of the JWT).

5. Commercialize Your Own Plugin

Are you a developer who has built an incredibly useful, domain-specific Tempo plugin (e.g., medical billing cycles, legal discovery windows, complex religious calendars)?

If you would like to monetize your logic without having to build your own licensing infrastructure, we want to partner with you.

Get in touch with us with your proposed code and use-case. If it meets our quality and performance standards, we can publish it as an official Premium Extension secured behind the Tempo License Key system, under a mutually beneficial commercial revenue-sharing arrangement.

Proprietary Commercial Software.