API Reference
API Reference for the OkHi JavaScript browser library
new okcollect(target, props)
DOM Element where the OkCollect component is mounted
See below
props
Api key string
User's first name (Optional)
User's last name (Optional)
User's phone number
Callback to be called with UserAddress once an address has been created/selected
Callback to be called with Error object
Controls whether features for capturing the user's gate photo on streetview are enabled (Optional)
Controls whether features for capturing detailed user address data(building, apartment etc.) are enabled (Optional)
styleSettings
(Optional) See below
See below
Controls the component light/dark theming (Optional. Defaults to false)
If set to true users will only be able to create new addresses, not select from pre-existing addresses (Optional. Defaults to false)
(optional) See below
props <
Object
>API_KEY <
string
> Api key stringuserFirstName <
string
> User's first name (Optional)userLastName <
string
> User's last name (Optional)userPhoneNumber <
string
> User's phone numberonAddressSelected <(
UserAddress
) => void> Callback to be called with UserAddress once an address has been created/selectedonError <(
Error
) => void> Callback to be called with Error objectstreetviewEnabled <
boolean
> Controls whether features for capturing the user's gate photo on streetview are enabled (Optional)toTheDoorEnabled <
boolean
> Controls whether features for capturing detailed user address data(building, apartment etc.) are enabled (Optional)isDarkMode <boolean> Controls the component light/dark theming (Optional. Defaults to false)
createOnly <boolean> If set to true users will only be able to create new addresses, not select from pre-existing addresses (Optional. Defaults to false)
UserAddress
id: <
string
> The id of the addressuser_id: <
string
> The user's id in OkHiurl: <
string
> A public link to view the OkHi addressstreet_name: <
string
> Name of the streetdirections: <
string
> (Optional) Directions to the locationproperty_name: <
string
> (Optional) Name of the buildingdisplay_title: <string> Full text address