{"id":49791,"library":"xinmods","title":"XIN Mods JS","description":"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.","status":"active","version":"1.7.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install xinmods","lang":"bash","label":"npm"},{"cmd":"yarn add xinmods","lang":"bash","label":"yarn"},{"cmd":"pnpm add xinmods","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"HTTP client for REST API calls","package":"axios","optional":false},{"reason":"In-memory caching layer for API responses","package":"cache","optional":true}],"imports":[{"note":"Package uses CommonJS; no default export. Use require() and then call connectTo on the returned object.","wrong":"import { connectTo } from 'xinmods';","symbol":"connectTo","correct":"const xinmods = require('xinmods'); const hippo = xinmods.connectTo('http://example.com', 'user', 'pass');"},{"note":"Correct pattern is destructuring from require. However, direct property access also works, but destructuring is idiomatic.","wrong":"const HippoConnection = require('xinmods').HippoConnection;","symbol":"HippoConnection","correct":"const { HippoConnection } = require('xinmods');"},{"note":"Also CommonJS only. QueryBuilder is exported as a named export.","wrong":"import { QueryBuilder } from 'xinmods';","symbol":"QueryBuilder","correct":"const { QueryBuilder } = require('xinmods'); const qb = new QueryBuilder();"}],"quickstart":{"code":"const xinmods = require('xinmods');\n\nconst hippo = xinmods.connectTo(\n  process.env.HIPPO_URL ?? 'http://localhost:8080',\n  process.env.HIPPO_USER ?? 'admin',\n  process.env.HIPPO_PASS ?? 'admin'\n);\n\nasync function main() {\n  const doc = await hippo.getDocumentByUuid('c0c9833c-144a-40a1-a5ba-2fd49aeebe98');\n  console.log('Document:', doc);\n}\n\nmain().catch(console.error);","lang":"javascript","description":"Shows how to initialize a HippoConnection and fetch a document by UUID."},"warnings":[{"fix":"Set CACHE_TTL (seconds) and CACHE_DEBUG (true/false) as environment variables, or disable caching by passing { caching: false } in options.","message":"The caching mechanism relies on environment variables CACHE_TTL and CACHE_DEBUG. If not set, caching may behave unexpectedly.","severity":"gotcha","affected_versions":"*"},{"fix":"Ensure attributes are fully qualified with namespace prefix (e.g., 'test:title').","message":"The getDocuments method's 'attributes' parameter expects a simple array of strings, but there is no validation; incorrect keys may silently fail.","severity":"deprecated","affected_versions":"<=1.7.2"},{"fix":"Use raw doc if namespace information is required.","message":"The sanitiseDocument function removes namespace prefixes from keys. If you need the full namespaced keys, do not call sanitiseDocument.","severity":"gotcha","affected_versions":"*"},{"fix":"Use const xinmods = require('xinmods'); const hippo = xinmods.connectTo(...);","message":"In 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.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.7.2':23 '2022':84 'api':65 'appear':81 'asset':38 'bloomreach':11 'build':36 'cach':43,48,50 'cadenc':76 'client':6 'cms':13,61 'complex':73 'control':44 'convers':34 'crud':32 'current':21 'custom':64 'debug':51 'differenti':53 'document':31 'endpoint':15,66 'environ':46 'extens':20 'fluid':70 'hippo':12,60 'hippoconnect':26 'includ':41 'instanc':62 'interact':9 'irregular':78 'javascript':5,85 'js':3 'key':52 'last':79 'librari':7 'manipul':39 'method':29 'mod':2,19,58 'mods-pow':57 'object':27 'offer':68 'option':42 'path/uuid':33 'power':59 'provid':24 'queri':35,74 'querybuild':71 'releas':75 'rest':14 'support':63 'tailor':54 'ttl':49 'updat':80 'variabl':47 'version':22 'via':16 'xin':1,18,56","created_at":"2026-06-07T17:03:37.846065+00:00","updated_at":"2026-06-07T17:03:37.846065+00:00","problems":[{"fix":"Use const xinmods = require('xinmods'); instead of import.","cause":"Using ES module import syntax (import) which doesn't work because package is CommonJS only.","error":"TypeError: xinmods.connectTo is not a function"},{"fix":"Verify HIPPO_URL environment variable or first argument to connectTo points to a reachable server.","cause":"The hippo URL is not set correctly or the service is not running.","error":"Error: getaddrinfo ENOTFOUND localhost"},{"fix":"Use xinmods.connectTo(...) rather than new HippoConnection().","cause":"Trying to new up HippoConnection directly instead of using the connectTo factory function.","error":"HippoConnection is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"xinmods","openapi_spec":null,"status_page":null,"smithery":null,"categories":["cms"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}