setHostPricingExtension()
Home > @gooddata/sdk-ui-pluggable-host > setHostPricingExtension
setHostPricingExtension() function
This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Registers a pricing extension that the default host chrome will consume to render trial-upgrade affordances. Optional — when no extension is registered, the chrome shows no upsell button and no pricing dialog.
Signature:
export declare function setHostPricingExtension(extension: UseHostPricingExtension | undefined): void;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
extension |
UseHostPricingExtension | undefined |
Returns:
void
Remarks
This indirection keeps the chrome free of any hard dependency on a specific pricing dialog implementation (e.g. gdc-pricing-dialog). The host app supplies the extension at boot; removing the extension is a one-line change.
Contract: - MUST be called once before the first render of <Root>. - The supplied function MUST obey React Rules of Hooks — it is invoked from HostChrome's render. - Swapping or unregistering the extension after first render is unsupported and will violate Rules of Hooks.