npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@garchicms/garchi-node-sdk

v0.0.4

Published

Node SDK for light weight wrapper for Garchi CMS API

Readme

📖 Table of Contents

GarchiCMS SDK

GarchiCMS SDK is a TypeScript library for interacting with the Garchi CMS API. It provides a simple, modular, and intuitive interface for managing categories, data items, reviews, reactions, spaces, and headless web APIs.

You can find the API documentation here

Features

  • Manage Data Items: Create, update, delete, and fetch data items.
  • Handle Categories: Create, update, delete, and list categories.
  • Manage Spaces: Create, update, and fetch spaces.
  • Handle Reviews: Create, update, delete, and fetch reviews.
  • Manage Reactions: Add or remove reactions for items or reviews.
  • Perform Compound Queries: Execute complex queries across items, categories, and reviews.
  • Work with Headless CMS: Manage assets, pages, and section templates.

Installation

npm install @garchicms/garchi-node-sdk

Usage

This SDK is a wrapper around the Garchi CMS API. providing easy-to-use modular functions that map directly to API endpoints.

Importing the SDK

import GarchiCMS from '@garchicms/garchi-node-sdk';

Initializing the Client

const garchi = new GarchiCMS({ api_key: 'YOUR_API_KEY' });

Module mapping

Each module corresponds to a specific API group:

Each module return values corresponds to the return value of the respective API Endpoint. The only difference being the excluding the paginated API endpoints, each module return value can be accessed without the .data attribute.

Example usages

Here are some example usages

Data item API

Create a Data Item

const newItem = await garchi.dataItem.create({
  space_uid: 'your_space_uid',
  name: 'New Item',
  categories: [1, 2, 3],
});

Get All Items

const items = await client.dataItem.getAll({ size: 10 });

Category API

Create a Category

const newCategory = await client.category.create({
  category: 'New Category',
  space_uid: 'your_space_uid'
});

Get All Categories

const categories = await client.category.getAll();

Review API

Create a Review

const review = await client.review.create({
  item_id: 1,
  rating: 5,
  review_body: 'Excellent product!',
  user_email: '[email protected]',
  user_name: 'John Doe'
});

Reaction API

Add or Update Reaction

const reaction = await client.reaction.manage({
  reaction: 'like',
  user_identifier: '[email protected]',
  review_id: 1,
  item_id: 1,
  reaction_for: 'review'
});

Space API

Create a Space

const newSpace = await client.space.create({
  name: 'New Space',
  logo: yourLogoFile
});

Compound Query API

Perform a Compound Query

const queryResult = await client.compoundQuery.query({
  dataset: 'items',
  fields: ['name', 'price'],
  conditions: ['like', 'gte'],
  values: ['%item%', '10'],
  logic: ['and']
}, { order_key: 'name', order_by: 'asc' });

Headless CMS API

Get a Page

const page = await client.headless.getPage({
  space_uid: 'your_space_uid',
  slug: '/',
  lang: 'en-US',
  mode: 'live'
});

Error Handling

All API calls return promises and throw errors if the API call fails.

try {
  const item = await client.dataItem.getItem({ item: 1 });
  console.log(item);
} catch (error) {
  console.error('Error:', error);
}

Types and Interfaces

The SDK exports types and interfaces for better TypeScript support.

import { GarchiItem, GarchiCategory, GarchiReview } from '@garchicms/garchi-sdk-node';

Contributing

Feel free to submit issues and pull requests to improve the SDK.

License

This project is licensed under the MIT License.