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
Description
system.getProductContext()returns the current host runtime's product context as{ productId: string }.productIdis the full canonical identifier, for exampletruapi-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
productId, not only its suffix..dot,.paseo,.test, and localhost without product-side construction or normalization.Tasks