https://github.com/constructor-io/constructorio-node
A Node.js client helper library for the Constructor.io API
https://github.com/constructor-io/constructorio-node
autocomplete constructorio constructorio-integrations http javascript nodejs rest-client search
Last synced: 9 months ago
JSON representation
A Node.js client helper library for the Constructor.io API
- Host: GitHub
- URL: https://github.com/constructor-io/constructorio-node
- Owner: Constructor-io
- License: mit
- Created: 2015-06-26T20:15:42.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-03-10T22:29:39.000Z (10 months ago)
- Last Synced: 2025-04-12T17:23:16.205Z (9 months ago)
- Topics: autocomplete, constructorio, constructorio-integrations, http, javascript, nodejs, rest-client, search
- Language: JavaScript
- Homepage:
- Size: 3.13 MB
- Stars: 13
- Watchers: 23
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Constructor.io Node Client
[](https://www.npmjs.com/package/@constructor-io/constructorio-node)
[](https://github.com/Constructor-io/constructorio-node/blob/master/LICENSE)
A Node.js 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).
> This client is intended for use in server side integrations. If you want a JavaScript client for client side (i.e. front end) integrations please use [@constructor-io/constructorio-client-javascript](https://github.com/Constructor-io/constructorio-client-javascript)
## Documentation
Full API documentation is available on [Github Pages](https://constructor-io.github.io/constructorio-node)
Updating from v3 to v4? Be sure to read the [upgrade guide](https://github.com/Constructor-io/constructorio-node/wiki/Migration-Guide---V3-to-V4) for an explanation of changes made to the Catalog module
## 1. Review the Requirements
Requesting results from your Node.js back-end can be useful in order to control result rendering logic on your server, or augment/hydrate results with data from another system. However, a back-end integration has additional requirements compared to a front-end integration. Please review the [Additional Information For Backend Integrations](https://github.com/Constructor-io/constructorio-node/wiki/Additional-Information-For-Backend-Integrations) article within the wiki for more detail.
## 2. Install
This package can be installed via npm: `npm i @constructor-io/constructorio-node`. Once installed, simply import or require the package into your repository.
**Important**: this library should only be used in a server-side context.
## 3. Retrieve an API key and token
You can find this in your [Constructor.io dashboard](https://constructor.io/dashboard). Contact sales if you'd like to sign up, or support if you believe your company already has an account.
## 4. Implement the Client
Once imported, an instance of the client can be created as follows:
```javascript
const ConstructorIOClient = require('@constructor-io/constructorio-node');
var constructorio = new ConstructorIOClient({
apiKey: 'YOUR API KEY',
});
```
## 5. Retrieve Results
After instantiating an instance of the client, four modules will be exposed as properties to help retrieve data from Constructor.io: `search`, `browse`, `autocomplete`, `recommendations`, `catalog` and `tracker`.
## Development / npm commands
```bash
npm run lint # run lint on source code and tests
npm run test # run tests
npm run coverage # run tests and serves coverage reports from localhost:8081
npm run docs # output documentation to `./docs` directory
```