END-to-end tutorials
building a landing page
extracting and plotting shapes and data from pdfs
monitoring social media collections, extracting and plotting recent events
simulating source + sink dynamics
building a dynamic, multi-layer interactive atlas
automatically publish a weekly summary newsletter
a simple two-player game
Understanding the Plugin API, Scope and Hooks
Plugin API and hooks establish a communication protocol between plugins and the Horizon Core. Scope determines whether changes are made to the underlying space, to a specific simulation, or to a specific user session.
The Plugin API is the language Horizon plugin developers use to send messages to the Horizon core application. Take a look at the Horizon SDK API Behaviour to see the API in elixir.
As seen in the behaviours list, the Plugin API provides methods for programmatically modifying all of the entities described in Horizon documentation thus far.
Each plugin API in the SDK has two additional fields: scope and adapter.
The Scope
The scope parameter is a map which is used to specify the, well, scope of the API call being made. This parameter's behavior may differ from function to function, but the fundamental is the same: is this API call meant to alter the entire space for all users, the state of a simulation for all users, the UI for just a specific user, or the UI for a single session?
The scope parameter determines this. For instance, you might be using a plugin to track the total amount of time a user is spending on a space and send that information back to a user. In that case, you'll use the 'user_id' scope.
Adapter State
Adapter state is the metadata for a single Plugin channel. It often stays constant and represents the metadata that determines the computation environment. It is likely that in the future the adapter will be represented by a single token and stored within the Horizon core, stay tuned.
Hooks
Hooks are events which the Horizon core sends outward that plugin developers can use to trigger actions. Hooks are crucial for building a two-way communication between plugins and horizon cores. Hooks can be cron-like entities (allowing plugins to register changes every minute, hour, or day), or they are resulting from direct actions of a user (a user clicking on a certain button, scrolling to a set window, or user-built site events being triggered).

Hook API functions
horizon.tech
A low-code platform for data collection, schema management, data visualization, and publishing.
© 2024 - 2025 Yrbia LLC, Delaware. All rights reserved.