Install

Install the optional @kelpclick/client JS SDK with npm, yarn, pnpm, or a CDN ESM script.

The JS SDK is optional. Magento, Liquid, PHP, and scripts can call the Kelp API with no npm. Use this page when you already have a JavaScript app, or when you want createKelpClient in a theme without a bundler.

You still need a tenant slug and a scoped API key from the tenant dashboard.

Package manager

npm install @kelpclick/client@latest

React 18 or later is a peer dependency, required only if you use the @kelpclick/client/react entry point. The core search and analytics modules have no React dependency.

CDN ESM

Load the SDK from a CDN when you want createKelpClient in a theme without a bundler:

<script type="module">
  import { createKelpClient } from 'https://cdn.jsdelivr.net/npm/@kelpclick/client@latest/+esm';

  const kelp = createKelpClient({
    searchUrl: 'https://{TENANT_ID}-search.kelp.click',
    analyticsUrl: 'https://{TENANT_ID}-events.kelp.click',
    apiKey: 'kelp_...',
  });
</script>

Magento and Liquid storefronts can skip this and fetch the API instead.

Subpath exports

The package ships dual ESM and CJS builds with full TypeScript declarations and tree-shakeable subpath exports. Import only the capabilities your JS project needs.

Import pathContents
@kelpclick/clientEverything - createKelpClient, createAnalytics, createIdentity, createKelpSearch, createKelpEmail, errors, types, VERSION.
@kelpclick/client/searchcreateKelpSearch(config) - search and browse.
@kelpclick/client/analyticscreateAnalytics(options) and event taxonomy types.
@kelpclick/client/emailcreateKelpEmail(options) - subscribe and unsubscribe.
@kelpclick/client/reactKelpProvider, useSearch, useBrowse, and context hooks.
// Root - re-exports everything
import { createKelpClient } from '@kelpclick/client';

// Capability subpaths - import only what you need
import { createKelpSearch } from '@kelpclick/client/search';
import { createAnalytics } from '@kelpclick/client/analytics';
import { createKelpEmail } from '@kelpclick/client/email';
import { KelpProvider, useSearch } from '@kelpclick/client/react';

CommonJS

const { createKelpClient } = require('@kelpclick/client');

Next steps

On this page