Prerequisites
Before installing, ensure you have:- A Constructor.io account with an API key
- Node.js and npm/yarn/pnpm installed (for package manager installation)
- A modern browser that supports the Fetch API
You can find your API key in your Constructor.io dashboard. Contact sales if you’d like to sign up, or support if your company already has an account.
Package Manager Installation
Install the SDK using your preferred package manager:Import in Your Application
Once installed, import or require the package:Bundled Version (CDN)
For projects that don’t use a build system, you can use the pre-bundled version:Step 1: Download the Bundle
The bundled version is available in the./dist folder of the GitHub repository:
constructorio-client-javascript.js- Development version with commentsconstructorio-client-javascript.min.js- Minified production version
Step 2: Include in Your HTML
Package Information
Package Name:
@constructor-io/constructorio-client-javascriptCurrent Version: 2.75.1License: MITBundle Size: Check bundlephobia for current minified and gzipped sizeDependencies
The SDK has minimal dependencies:Core Dependencies
@constructor-io/constructorio-id- Automatic client and session ID managementcrc-32- CRC32 checksum implementation
Peer Dependencies
@babel/runtime(^7.19.0) - Required for transpiled code
Most modern package managers will automatically install peer dependencies. If you encounter issues, install
@babel/runtime manually:TypeScript Support
The SDK includes TypeScript type definitions out of the box:package.json
@types package is needed. TypeScript will automatically detect the type definitions when you import the client.
Verify Installation
To verify the installation was successful, create a simple test:Next Steps
Quickstart Guide
Follow our quickstart guide to make your first search request