v6.0.1
  • 👋Welcome Home
  • OVERVIEW
    • OkHi Product Overview
    • Integration process overview
    • Verification terminology
    • Case Studies
  • Best Practices
    • Integration Best Practices
    • Live Examples
    • Tips for PMs & QA
      • Testing & QA Guide
      • Publishing to app stores
        • Google Play store
        • Apple App Store
    • Tips for designers
  • Code Libraries
    • Developer Quick Start
      • Environment setup
      • Release Notes
    • Android Guide
      • Android Dependencies
      • Migrating to the latest library
    • iOS Guide
    • React Native Guide
      • React Native Dependencies
      • React Native troubleshoot guide
    • Expo React Native Guide
    • Flutter Guide
      • Flutter Dependencies
    • JS library
      • API Reference
      • OkCollect Webhook
      • Changelog
    • WooCommerce Plugin
      • Changelog
  • Verification Status
    • Customer Dashboard
    • Verification Status Updates
      • Webhook v3
        • Webhook Signature Verification Guide
      • Webhook v2
      • Verification Status API
      • Proof Of Address Certificate API
      • FAQs
    • API reference docs
  • Troubleshooting
    • Error Responses
    • Common technical pitfalls
    • How to reduce "Unknowns"
    • FAQs
      • Technical FAQs
      • Compliance FAQs
    • Get in touch
Powered by GitBook
On this page
  • new okcollect(target, props)
  • UserAddress

Was this helpful?

  1. Code Libraries
  2. JS library

API Reference

API Reference for the OkHi JavaScript browser library

PreviousJS libraryNextOkCollect Webhook

Was this helpful?

new okcollect(target, props)

Argument
Description

DOM Element where the OkCollect component is mounted

See below

props

Argument
Description

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 <>

    • API_KEY <> Api key string

    • userFirstName <> User's first name (Optional)

    • userLastName <> User's last name (Optional)

    • userPhoneNumber <> User's phone number

    • onAddressSelected <() => void> Callback to be called with UserAddress once an address has been created/selected

    • onError <() => void> 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)

      • primaryColor <> Controls the primary theme color of UI elements(Usually corresponds to the parent app's primary color or the business' brand color)

      • highlightColor <> A secondary theme color that contrasts well with the primary color

    • appSettings <>

      • name <> The parent app's name

      • version <> The parent app's version number

    • isDarkMode <> Controls the component light/dark theming (Optional. Defaults to false)

    • createOnly <> If set to true users will only be able to create new addresses, not select from pre-existing addresses (Optional. Defaults to false)

    • requiredFieldsConfig <> (optional)

      • buildingNameOrNumber <> If set to true requires the user to provide a building name value. The "Building Name or Number" input on the final ToTheDoor screen will be required.(Optional. Defaults to false).

UserAddress

target <>

props <>

API_KEY <>

userFirstName <>

userLastName <>

userPhoneNumber <>

onAddressSelected <() => void>

onError <() => void>

streetviewEnabled <>

toTheDoorEnabled <>

appSettings <>

isDarkMode <>

createOnly <>

requiredFieldsConfig <> (optional)

geo_point: <>

lon: <> longitude of the address

lat: <> latitude of the address

id: <> The id of the address

user_id: <> The user's id in OkHi

url: <> A public link to view the OkHi address

street_name: <> Name of the street

directions: <> (Optional) Directions to the location

property_name: <> (Optional) Name of the building

display_title: <> Full text address

street_view <> (Optional)

geo_point <>

lon: <> longitude of the address

lat: <> latitude of the address

pano_id: <> Streetview pano id

url: <> Streetview url

Object
number
number
string
string
string
string
string
string
string
Object
Object
number
number
string
string
Object
string
string
string
string
Error
boolean
boolean
Object
string
string
Object
string
string
boolean
boolean
Object
boolean
UserAddress
HTMLElement
Object
string
string
string
string
Error
boolean
boolean
Object
boolean
boolean
Object
UserAddress