getConfig( )


Retrieves the configuration of your shipping rates plugin.

Set your shipping rates configuration in the return of the getConfig() function. Wix calls this function when you publish your site. Changes to the configuration don't take effect until you publish your site.

The object returned by getConfig() contains values used to display the extended shipping rate on your site's dashboard.

Where to find getConfig()

When you add the Shipping Rates service plugin, a folder is automatically added to your site. Use the -config.js file in the folder to set the default configuration for your implementation of the service plugin.

For more information on setting your configuration, see Tutorial: Shipping Rates Service Plugin.

Method Declaration
Copy
function getConfig(): Promise<ShippingRatesConfigResponse>;
Request
This method does not take any parameters
Returns
Return Type:Promise<ShippingRatesConfigResponse>
Example of a configuration file
JavaScript
// Place this code in the <my-extension-name>-config.js file // in the 'ecom-shipping-rates' folder of the // Custom Extensions section on your site. export function getConfig() { return { name: "East-Coast Shipping Provider", description: "Providing shipping options for the US east-coast", }; }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?