Alokai

Config

Full configuration accepted by the Magento API client, extending ClientConfig with Apollo client, reCAPTCHA, storage and Magento-specific settings.

interface Config<T = any> extends ClientConfig {
	client?: ApolloClient<T>;
	cookieOptions?: Record<string, CookieOptions>;
	customApolloHttpLinkOptions?: HttpOptions;
	customOptions?: Partial<ApolloClientOptions<any>>;
	imageProvider: string;
	magentoApiEndpoint: string;
	magentoBaseUrl: string;
	overrides: Endpoints;
	recaptcha: RecaptchaConfig;
	storage: Storage;
}

Properties

NameRequiredTypeDescription
clientOptionalApolloClient<T>Pre-configured Apollo client instance. When provided, it is used as-is instead of creating a new client.
cookieOptionsOptionalRecord<string, CookieOptions>Express cookie options applied when setting state cookies, keyed by cookie name.
customApolloHttpLinkOptionsOptionalHttpOptionsOptions merged into the Apollo HttpLink (for example to add headers or override the request URI).
customOptionsOptionalPartial<ApolloClientOptions<any>>Partial Apollo client options merged when constructing the client. When a link is provided here it is used to build the client directly.
imageProviderRequiredstringIdentifier of the image provider used when building product image URLs.
magentoApiEndpointRequiredstringURL of the Magento GraphQL API endpoint.
magentoBaseUrlRequiredstringBase URL of the Magento instance.
overridesRequiredEndpointsAPI method overrides replacing or extending the default endpoints.
recaptchaRequiredRecaptchaConfigreCAPTCHA configuration.
storageRequiredStorageStorage implementation used to persist data.

Referenced Types

On this page