API Reference
API Reference for the OkHi JavaScript browser library
new okcollect(target, props)
target <HTMLElement
>
DOM Element where the OkCollect component is mounted
props <Object
>
See below
props
API_KEY <string
>
Api key string
userFirstName <string
>
User's first name (Optional)
userLastName <string
>
User's last name (Optional)
userPhoneNumber <string
>
User's phone number
onAddressSelected <(UserAddress
) => void>
Callback to be called with UserAddress once an address has been created/selected
onError <(Error
) => void>
Callback to be called with Error object
streetviewEnabled <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)
styleSettings
(Optional) See below
appSettings <Object
>
See below
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)
requiredFieldsConfig <Object> (optional)
(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
Was this helpful?