Installing and capabilities

Install your organization's components in a project and review what they can do.

A project uses a component from your organization once someone installs it. Installing records the version the project uses and the capabilities you accepted for it.

Install a component

On the project's Components page, open Organization, choose a component and select Install. Before anything changes, you see what the component can do and which version you get. When it asks for capabilities, accept them to install it.

With the CLI:

npx voidhash-cli registry install acme/plan-picker
npx voidhash-cli registry install acme/plan-picker --yes

The first command shows the review and stops if it needs your consent; --yes accepts it.

A new install follows versions compatible with the newest one, such as ^1.2.0. Pass --range to choose another: *, an exact version such as 1.2.0, ^1.2.0 (same major version) or ~1.2.0 (same minor version).

Installed components appear in the designer under Installed and in the Voidhash agent's component list. The agent can place installed components but cannot install them: installing is always a person's decision.

Capabilities

Capabilities say what a component can do for the person using your app:

CapabilityThe component can
commerceStart purchases and restore them.
linksOpen links.
analyticsRecord analytics events.
navigationClose the paywall.
hapticsPlay haptic feedback. Reserved: components cannot use it yet.

A component declares the capabilities it uses, in component.json and in its code with #[component(capabilities(commerce))]. Requests the component did not declare are refused. Firing an event needs no capability: the paywall decides what a bound event does, such as moving to another screen.

Components built before capabilities could be declared ask for commerce, links, analytics and navigation, since they may use any of them.

Installing asks you to accept the capabilities of the version you install, and an update asks again when a new version adds one. Which apps can show the component is a separate question, answered by their SDK version; see Older app versions.

Update a component

voidhash-cli registry list shows, in the UPDATE column of its installed components, the version an update would move to. Updating moves the project to the newest version in its range:

npx voidhash-cli registry update acme/plan-picker

On the Components page, select Review update on the Installed tab. The review lists what changes between the two versions. You need to accept an update that:

  • asks for a capability the installed version does not have, or
  • removes a prop or event, or changes its type.

Updates that only add props or events apply without it.

Components already placed in paywalls keep the version they were placed with until you update them in the designer. When the update removes a prop, the designer drops its value from the instances it updates and tells you which.

Publishing paywalls with installed components

A paywall can only be built when every component in it is installed in the project, its version is neither deprecated nor yanked, and the project accepted every capability that version asks for. Otherwise the build fails and names the component to fix. This is checked again when a build is deployed, so a version yanked or deprecated after the build stops the deploy too; the API answers with the same diagnostics as creating the release.

Uninstall

Uninstalling removes the component from the designer. Published paywalls keep working; paywalls that still place it cannot be published again until it is removed from them or installed again.

npx voidhash-cli registry uninstall acme/plan-picker