0.0.9 • Published 4 years ago
juniper-labs-io v0.0.9
Juniper Labs
Wrapper to access juniper labs api features
API documentation:
Installing
Using npm: Not supported yet.
Using cdn:
<script src="https://unpkg.com/juniper-labs-io/dist/index.var.js"></script>
Adding css for styling the auto complete component:
<link rel="stylesheet" type="text/css" href="https://unpkg.com/juniper-labs-io/dist/index.css" />
Usage
Business Prefill
Business Prefill Autocomplete component
// Create new client
new JuniperLabs.BusinessPrefill.AutoCompleteComponent(
YOUR_API_KEY,
BASE_API_URL, // Optional: defaults to https://prefill.juniperlabs-services.com/v0.1
).initializeComponent(
document.getElementById("business_name"), // required: input element to be connected with autocomplete
{
onSelect: (details) => { console.log(details) }, // optional: callback, invoked with business details when a user select a item from the autocomplete dropdown
registry_state: "CO" // optional
}
)
Example
You can find a working example code as gist here replace YOUR_API_KEY with your actual api key and then open the html file in your browser
codepen
https://codepen.io/puneet-sutar/pen/abNNVeY?editors=1111
Business Prefill Api Client
Typeahead API.
// Create new client
new JuniperLabs.BusinessPrefill.ApiClient(
YOUR_API_KEY,
BASE_API_URL, // Optional: defaults to https://prefill.juniperlabs-services.com/v0.1
).typeahead(
search_string, // required
registry_state, // optional
)
Typeahead API.
// Create new client
new JuniperLabs.BusinessPrefill.ApiClient(
YOUR_API_KEY,
BASE_API_URL, // Optional: defaults to https://prefill.juniperlabs-services.com/v0.1
).id(
id, // required: string
)