Registry / cms / xinmods

xinmods

JSON →
library1.7.2jsnpmunverified

A JavaScript client library for interacting with Bloomreach Hippo CMS REST endpoints via the XIN Mods extension. Current version 1.7.2 provides a HippoConnection object with methods for document CRUD, path/UUID conversion, query building, and asset manipulation. It includes optional caching controlled by environment variables (CACHE_TTL, CACHE_DEBUG). Key differentiators: tailored for XIN Mods-powered Hippo CMS instances, supports custom API endpoints, and offers a fluid QueryBuilder for complex queries. Release cadence is irregular; last update appears to be 2022.

npm install xinmods
INSTALL
IMPORT
SIG · XINMODS
X
xinmods
cmsjavascriptv1.7.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

connectTo
const xinmods = require('xinmods'); const hippo = xinmods.connectTo('http://example.com', 'user', 'pass');
import { connectTo } from 'xinmods';
Package uses CommonJS; no default export. Use require() and then call connectTo on the returned object.
HippoConnection
const { HippoConnection } = require('xinmods');
const HippoConnection = require('xinmods').HippoConnection;
Correct pattern is destructuring from require. However, direct property access also works, but destructuring is idiomatic.
QueryBuilder
const { QueryBuilder } = require('xinmods'); const qb = new QueryBuilder();
import { QueryBuilder } from 'xinmods';
Also CommonJS only. QueryBuilder is exported as a named export.

Shows how to initialize a HippoConnection and fetch a document by UUID.

const xinmods = require('xinmods'); const hippo = xinmods.connectTo( process.env.HIPPO_URL ?? 'http://localhost:8080', process.env.HIPPO_USER ?? 'admin', process.env.HIPPO_PASS ?? 'admin' ); async function main() { const doc = await hippo.getDocumentByUuid('c0c9833c-144a-40a1-a5ba-2fd49aeebe98'); console.log('Document:', doc); } main().catch(console.error);
Debug
Known issues
gotchaThe caching mechanism relies on environment variables CACHE_TTL and CACHE_DEBUG. If not set, caching may behave unexpectedly.
fix
Set CACHE_TTL (seconds) and CACHE_DEBUG (true/false) as environment variables, or disable caching by passing { caching: false } in options.
affects: *
deprecatedThe getDocuments method's 'attributes' parameter expects a simple array of strings, but there is no validation; incorrect keys may silently fail.
fix
Ensure attributes are fully qualified with namespace prefix (e.g., 'test:title').
affects: <=1.7.2
gotchaThe sanitiseDocument function removes namespace prefixes from keys. If you need the full namespaced keys, do not call sanitiseDocument.
fix
Use raw doc if namespace information is required.
affects: *
breakingIn version 1.0.0, the import structure changed from a single default export to named exports via CommonJS. Old code using require('xinmods') directly (without .connectTo) will break.
fix
Use const xinmods = require('xinmods'); const hippo = xinmods.connectTo(...);
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: xinmods.connectTo is not a function
Using ES module import syntax (import) which doesn't work because package is CommonJS only.
fix
Use const xinmods = require('xinmods'); instead of import.
Error: getaddrinfo ENOTFOUND localhost
The hippo URL is not set correctly or the service is not running.
fix
Verify HIPPO_URL environment variable or first argument to connectTo points to a reachable server.
HippoConnection is not a constructor
Trying to new up HippoConnection directly instead of using the connectTo factory function.
fix
Use xinmods.connectTo(...) rather than new HippoConnection().
Upgrade
Version history
1.7.2latest on npm
Audit
Dependencies
axiosrequiredHTTP client for REST API calls
cacheoptionalIn-memory caching layer for API responses
Agent activity
24 hits · last 30 days
node
20
Resources
xinmods — npm install xinmods · libregistry