Skip to main content

Connectivity API

The Connectivity API provides access to device connectivity information, allowing you to monitor Internet connection status and respond to connectivity changes in real-time. The API enables both immediate connectivity checks and dynamic updates when network conditions change.

  • Network monitoring: Monitor connectivity and handle network interruptions during transactions.
  • Status indicators: Display connectivity status to inform users about network availability.
  • Queue operations: Queue API calls and sync operations when connectivity is restored.
  • Retry logic: Implement retry logic for failed network operations.
Support
Targets (28)

The shopify global object provides access to the current connectivity state. Access the following properties on shopify to monitor network connectivity and respond to connectivity changes.

Anchor to current
current
<>
required

Provides read-only access to the current connectivity state and allows subscribing to connectivity changes. Use for implementing connectivity-aware functionality and reactive connectivity handling.


  • Handle connectivity changes gracefully: Use the subscribe method to automatically adapt your extension behavior when connectivity changes.
  • Design for connectivity awareness: Design your extension to handle network interruptions, informing users when network-dependent features are unavailable and providing clear guidance on next steps.
  • Provide clear connectivity feedback: Display connectivity status to users when it affects functionality, helping them understand why certain features may be limited or unavailable.
  • Queue operations during outages: Implement queuing mechanisms for non-critical operations that can be deferred until connectivity is restored.

Connectivity status reflects Internet connectivity only and may not indicate the quality or speed of the connection, which could affect API performance.


Was this page helpful?