{"id":26103458,"url":"https://github.com/constructor-io/constructorio-client-javascript","last_synced_at":"2026-01-26T12:25:09.050Z","repository":{"id":35125024,"uuid":"207638141","full_name":"Constructor-io/constructorio-client-javascript","owner":"Constructor-io","description":"Constructor.io JavaScript client for web applications","archived":false,"fork":false,"pushed_at":"2025-04-10T13:53:26.000Z","size":5270,"stargazers_count":20,"open_issues_count":1,"forks_count":6,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-04-12T17:23:40.793Z","etag":null,"topics":["autosuggest","browser","constructorio-integrations","javascript","recommendations","search"],"latest_commit_sha":null,"homepage":"https://constructor.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Constructor-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-09-10T18:49:22.000Z","updated_at":"2025-04-10T13:53:30.000Z","dependencies_parsed_at":"2023-10-04T00:51:33.563Z","dependency_job_id":"bf237b9c-cc8b-4ce7-bf43-b86a3405b6f2","html_url":"https://github.com/Constructor-io/constructorio-client-javascript","commit_stats":{"total_commits":411,"total_committers":19,"mean_commits":21.63157894736842,"dds":0.6958637469586375,"last_synced_commit":"f8b6b6b2a56686e127b0bf07f8d5485fb459bb64"},"previous_names":[],"tags_count":213,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Constructor-io%2Fconstructorio-client-javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Constructor-io%2Fconstructorio-client-javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Constructor-io%2Fconstructorio-client-javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Constructor-io%2Fconstructorio-client-javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Constructor-io","download_url":"https://codeload.github.com/Constructor-io/constructorio-client-javascript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248603004,"owners_count":21131720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autosuggest","browser","constructorio-integrations","javascript","recommendations","search"],"created_at":"2025-03-09T20:07:01.432Z","updated_at":"2026-01-26T12:25:09.044Z","avatar_url":"https://github.com/Constructor-io.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Constructor.io JavaScript Client\n\n[![npm](https://img.shields.io/npm/v/@constructor-io/constructorio-client-javascript)](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Constructor-io/constructorio-client-javascript/blob/master/LICENSE)\n[![Minzipped Size](https://img.shields.io/bundlephobia/minzip/@constructor-io/constructorio-client-javascript)](https://bundlephobia.com/result?p=@constructor-io/constructorio-client-javascript)\n\nA JavaScript client for [Constructor.io](http://constructor.io/). [Constructor.io](http://constructor.io/) provides search as a service that optimizes results using artificial intelligence (including natural language processing, re-ranking to optimize for conversions, and user personalization).\n\n\u003e This client is intended for use in a browser environment but can also be used in React Native based mobile applications.  Additional information about utilization in a React Native context can be found on the [Wiki](https://github.com/Constructor-io/constructorio-client-javascript/wiki/Utilization-in-a-DOM-less-environment).  If you want a JavaScript client for server side integrations please use [@constructor-io/constructorio-node](https://github.com/Constructor-io/constructorio-node) \n\n## Documentation\nFull API documentation is available on [Github Pages](https://constructor-io.github.io/constructorio-client-javascript/index.html)\n\n## 1. Install\n\nThis package can be installed via npm: `npm i @constructor-io/constructorio-client-javascript`. Once installed, simply import or require the package into your repository.\n\nAlternatively, a bundled version consisting of a single JavaScript file is published within the `./dist` folder on Github. This can be utilized within a browser context if hosted locally - _please do not link directly to the Github hosted version_.\n\n**Important**: this library should only be used in a client-side context where standard HTTP request headers are populated by the client (`User-Agent`, `Referer`, etc.).\n\n## 2. Retrieve an API key\n\nYou can find this in your [Constructor.io dashboard](https://app.constructor.io/dashboard). Contact sales if you'd like to sign up, or support if you believe your company already has an account.\n\n## 3. Implement the Client\n\nOnce imported, an instance of the client can be created as follows:\n\n```javascript\nconst ConstructorioClient = require('@constructor-io/constructorio-client-javascript');\n\nconst constructorio = new ConstructorioClient({\n    apiKey: 'YOUR API KEY',\n});\n```\n\n## 4. Retrieve Results\n\nAfter instantiating an instance of the client, seven modules will be exposed as properties to help retrieve data or send behavioral events: `search`, `browse`, `autocomplete`, `recommendations`, `quizzes`, `agent`, and `tracker`.\n\n#### Dispatched events\n\nModules may dispatch custom events on the browser `window` with response data when a request has been completed. The event name follows the following structure: `cio.client.[moduleName].[methodName].completed`. Example consuming code can be found below:\n\n```javascript\nwindow.addEventListener('cio.client.search.getSearchResults.completed', (event) =\u003e {\n  // `event.detail` will be response data\n}, false);\n```\n\n## Development / npm commands\n\n```bash\nnpm run lint          # run lint on source code and tests\nnpm run test          # run tests\nnpm run coverage      # run tests and serves coverage reports from localhost:8081\nnpm run docs          # output documentation to `./docs` directory\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconstructor-io%2Fconstructorio-client-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconstructor-io%2Fconstructorio-client-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconstructor-io%2Fconstructorio-client-javascript/lists"}