The Brush Context
Backend
The Brush Context is an enrichment of the native Gadget existing contexts passed to Gadget routes or to Gadget actions.
The Brush Context handles:
- App Proxy authentication: if Gadget instanciates the context from a REST request, Brush handles App Proxy authentication to ensure such request comes from a shop that has your app installed.
- Shopify shop loading: Brush enriches the context with the current instance of Gadget’s
shopifyShopmodel. - Shopify Admin API client: Brush automatically loads the Shopify Admin API client for the current shop. See Shopify Admin API.
- Shopify Storefront API client: Brush automatically loads the Shopify Storefront API client for the current shop. See Shopify Storefront API.
- Localization: Brush automatically enriches the context with the current shop’s currency, locale and country.
- Current customer: Brush automatically enriches the context with current customer ID if it was passed by the frontend thry a REST call.
Of course, all other properties from the native Gadget contexts are available.