Skip to content

RFC: Current product context #503

Description

@pgherveou

Description

system.getProductContext() returns the current host runtime's product context as { productId: string }. productId is the full canonical identifier, for example truapi-playground.paseo.

const context = await truapi.system.getProductContext();

context.value.productId;
// "truapi-playground.paseo"

Motivation

Account and signing APIs require a full dotNsIdentifier, but products cannot query the exact identifier the host uses for authorization and account derivation. They must hardcode a suffix, inspect their URL, or guess the active network.

Requirements

  • Return the complete canonical productId, not only its suffix.
  • The value exactly matches the identifier used by the host for authorization and account derivation.
  • The contract covers .dot, .paseo, .test, and localhost without product-side construction or normalization.

Tasks

  • RFC document body
  • Implementation — rust-core

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions