For the complete documentation index, see llms.txt. This page is also available as Markdown.

Actinium Domain Model

Artifacts

File

Description

middleware.js

Express middleware file for registering middleware.

plugin.js

Actinium plugin file for registering a plugin.

sdk.js

File in a plugin directory that defines an extension to the Actinium SDK. (optional)

route.js

File in a plugin directory that defines data driven routes for dynamic routes in the admin or another UI application. (optional)

blueprints.js

File in a plugin directory that defines UI layouts for the Admin. (optional)

schema.js

File in a plugin directory that defines DB schema information for registering Parse Collections

plugin.js

Actinium will attempt to add any file within the /src/app directory with a file name that ends with plugin.js and execute in the file scope.

A typical plugin.js file may look like:

/src/app/MyPlugin/plugin.js
const PLUGIN = {
    ID: 'MyPlugin',
    description: 'My plugin is here!',
    name: 'My Plugin',
};

const COLLECTION = 'MyPluginCollection'; 

// Register plugin
Actinium.Plugin.register(PLUGIN);

// Define a cloud function
Actinium.Cloud.define(PLUGIN.ID, 'my-plugin-log', req => {
    console.log(req.params); 
    return { message: 'OK', status: 200, ...req.params };
});

// Define an after save function that will run an after-save hook 
Actinium.Cloud.afterSave(COLLECTION, async req => {
    // run this code if MyPlugin is active
    if (!Actinium.Plugin.isActive(PLUGIN.ID)) return;
    await Actinium.Hook.run(`${COLLECTION}-after-save`, req); 
    console.log(`Saved a ${COLLECTION} object!`); 
});

// Register a start hook 
Actinium.Hook.register('start', () => {
    // run this code if MyPlugin is active
    if (!Actinium.Plugin.isActive(PLUGIN.ID)) return;
    console.log(PLUGIN.ID, 'Yo!');
});

middleware.js

Actinium will attempt to add any file within the /src/app directory with a file name that ends with middleware.js and execute it in the file scope.

A typical middleware.js file may look like:

Actinium will traverse node_modules/**/actinium directories for plugin.js and middleware.js artifacts.

Last updated