API Reference
API Reference for the OkHi JavaScript browser library
new okcollect(target, props)
Argument | Description |
---|---|
target < | DOM Element where the OkCollect component is mounted |
props < | See below |
props
Argument | Description |
---|---|
API_KEY < | Api key string |
userFirstName < | User's first name (Optional) |
userLastName < | User's last name (Optional) |
userPhoneNumber < | User's phone number |
onAddressSelected <( | Callback to be called with UserAddress once an address has been created/selected |
onError <( | Callback to be called with Error object |
streetviewEnabled < | Controls whether features for capturing the user's gate photo on streetview are enabled (Optional) |
toTheDoorEnabled < | Controls whether features for capturing detailed user address data(building, apartment etc.) are enabled (Optional) |
styleSettings | (Optional) See below |
appSettings < | 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