Configuration Options
Configuration Object
The kvikkMapWidget.open() method accepts a configuration object with the following properties:
Required Parameters
apiKey (string, required)
Your unique API key obtained from developer.kvikk.hu. This key authenticates your requests to the Kvikk Map API.
apiKey: "09f78fa0e67c9f8a29e26ec547d56af6bfc74f176c72a08940f004a3a89fa1fc"
couriers (array, required)
An array of courier services and pickup point types to display on the map. Each courier object must include:
courier(string): The courier identifier (slug)type(string): The pickup point type (e.g., "locker", "shop")price(object): Pricing per country code
couriers: [
{
courier: "gls",
type: "locker",
price: {
hu: 1500, // Hungary
ro: 2500, // Romania
sk: 1000, // Slovakia
},
},
{
courier: "mpl",
type: "posta",
price: {
hu: 0, // Free shipping
},
},
]
See the Available Couriers page for a complete list of supported courier IDs and point types.
callback (function, required)
A callback function that receives the selected pickup point data when the user confirms their selection.
callback: (point) => {
console.log("Selected point:", point);
// Save to your system
// Update UI
// Proceed with checkout
}
Optional Parameters
language (string, optional)
The interface language. Supported values:
"hu"- Hungarian (default)"en"- English
language: "en"
currency (string, optional)
The currency code to display prices. Defaults to "HUF".
currency: "HUF"
geolocation (bool, optional)
When the user clicks in the search field, it will ask for geolocation permissions. This can be turned off with this parameter. Defaults to true.
geolocation: false
customPoints (array, optional)
Add custom pickup locations that aren't part of the standard courier networks. Useful for store pickup or special locations. The recommended icon is a 48x48px SVG file.
customPoints: [
{
name: "Store Pickup",
courier: "custom",
type: "custom",
id: "custom-01",
price: 0,
icon: "https://example.com/store-icon.svg",
lat: 47.2309,
lon: 16.6216,
addr: "Main Street 123",
city: "Budapest",
zip: "1000",
comment: "Opitonal comment field"
},
]
defaultPosition (object, optional)
Set the initial map position when opened. the postalCode parameter at the moment only supports Hungary. The country parameter supports all EU countires.
defaultPosition: {
country: "HU", // Country code (optional)
postalCode: "1000", // Postal/ZIP code (optional)
coordinates: {
lat: 47.4979,
lon: 19.0402
}
}
color (object, optional)
Customize the widget's color scheme to match your brand.
color: {
primary: "#35C287", // Primary color (buttons, accents)
text: "#2C3F56", // Text color
}
Testing Parameters
_showError (boolean, optional)
Force the widget into fallback/error mode for testing purposes. When enabled, displays a manual text input field instead of the map.
_showError: true // Only for testing
This parameter is intended for testing only. Do not use in production.
Complete Example
kvikkMapWidget.open({
// Required
apiKey: "your_api_key_here",
callback: (point) => {
if (point.fallbackInfo) {
// User entered manual address
console.log("Fallback address:", point.fallbackInfo);
} else {
// Standard pickup point selected
console.log("Selected:", point.name, point.addr);
}
},
couriers: [
{
courier: "gls",
type: "locker",
price: { hu: 1500 },
},
{
courier: "foxpost",
type: "foxpost",
price: { hu: 1200 },
},
],
// Optional
language: "en",
currency: "HUF",
defaultPosition: {
country: "HU",
postalCode: "1000",
},
color: {
primary: "#35C287",
text: "#2C3F56",
},
customPoints: [
{
name: "Store Pickup - Downtown",
courier: "custom",
type: "custom",
id: "store-01",
price: 0,
icon: "https://example.com/store.svg",
lat: 47.4979,
lon: 19.0402,
addr: "Váci utca 1-3",
city: "Budapest",
zip: "1052",
comment: "Opitonal comment"
},
],
});
Reload Behavior
The map widget intelligently handles multiple open calls:
- Same configuration: The map will reopen instantly without reloading
- Changed configuration: The map will reload with the new settings
This ensures optimal performance while maintaining flexibility.