Returns the full API object that was passed in to your extension when it was created. Depending on the extension point, this object can contain different properties. For example, the `Checkout::CartLineDetails::RenderAfter` extension point will return the [CartLineDetailsApi](/docs/api/checkout-ui-extensions/apis/cartlinedetailsapi) object. Whereas others return the [StandardApi](/docs/api/checkout-ui-extensions/apis/standardapi) object. For reference, see [ExtensionPoints](/docs/api/checkout-ui-extensions/apis/extensionpoints) to determine what API object will be returned by your extension point.
import React from 'react';
import {
render,
Text,
useExtensionApi,
} from '@shopify/checkout-ui-extensions-react';
render('Checkout::Dynamic::Render', () => (
));
function Extension() {
const {shop} = useExtensionApi();
return Shop name: {shop.name} ;
}
Returns the full API object that was passed in to your extension when it was created. Depending on the extension point, this object can contain different properties. For example, the `Checkout::CartLineDetails::RenderAfter` extension point will return the [CartLineDetailsApi](/docs/api/checkout-ui-extensions/apis/cartlinedetailsapi) object. Whereas others return the [StandardApi](/docs/api/checkout-ui-extensions/apis/standardapi) object. For reference, see [ExtensionPoints](/docs/api/checkout-ui-extensions/apis/extensionpoints) to determine what API object will be returned by your extension point.
export function useExtensionApi< ID extends RenderExtensionPoint = RenderExtensionPoint, >(): ApiForRenderExtension<ID> { return useApi(); }
For a given rendering extension point, returns the type of the API that the extension will receive at runtime. This API type is the second argument to the callback for that extension point. The first callback for all of the rendering extension points each receive a `RemoteRoot` object.
ApiForRenderExtension<ID>