Skip to main content
This page lists the service objects and global helpers exported by @napps/component-extension. Use the Services guides for behavior-oriented examples.

NAPPS

NAPPS is the proxy object used when you prefer an explicit object over ambient globals.
The proxy exposes these members:
The same services are available as globals where the active surface registers them. Prefer the proxy in reusable modules because it makes the dependency visible and keeps calls easy to mock.

Storefront and customer calls

Both APIs return a typed GraphQL envelope. The optional properties object is passed as the request properties/variables object supported by the host.
Deprecated calls will be blocked. Migrate to the supported generic signature above: put the operation document in query, pass request values in the second properties object, and read data and errors from the returned envelope. Do not depend on older positional overloads.

App utilities

country and locale describe the current app context. formatCurrency returns a localized display string; it does not change the input amount.

Cart service

The service is optional on surfaces that do not have a cart host. Check it before using it. Use CartOperations when you need to return a batch of mutations from an extension.

App navigation

Navigation methods hand control to the native app. Validate external URLs in your extension before calling navigateToExternalPage.

Product and metaobject services

Product lookup methods resolve to null when no matching object exists. Treat these promises as the supported lookup APIs and handle null; do not infer that a missing product is exceptional.

Customer context

Authentication can change while the app is running. Read the context when the action occurs rather than caching it indefinitely.

Safe-area insets

Values are density-independent units. subscribe invokes the callback immediately with the current snapshot and returns an ID for cleanup.

Storage access

sessionStorage is synchronous and in-memory. For persistent scoped storage, see Runtime APIs and the AppStorage declarations in @napps/nodes runtime.