🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@smartive/datocms-utils

Package Overview
Dependencies
Maintainers
7
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smartive/datocms-utils

A set of utilities and helpers to work with DatoCMS in a Next.js project.

latest
npmnpm
Version
2.1.5
Version published
Maintainers
7
Created
Source

smartive DatoCMS Utilities

A set of utilities and helpers to work with DatoCMS in a Next.js project.

Installation

npm install @smartive/datocms-utils

Usage

Import and use the utilities you need in your project. The following utilities are available.

Utilities

Utilities for DatoCMS Cache Tags

The following utilities are used to work with DatoCMS cache tags and a Vercel Postgres database.

  • storeQueryCacheTags: Stores the cache tags of a query in the database.
  • queriesReferencingCacheTags: Retrieves the queries that reference cache tags.
  • deleteQueries: Deletes the cache tags of a query from the database.

Setup Postgres database

In order for the above utilites to work, you need to setup a the following database. You can use the following SQL script to do that:

CREATE TABLE IF NOT EXISTS query_cache_tags (
  query_id TEXT NOT NULL,
  cache_tag TEXT NOT NULL,
  PRIMARY KEY (query_id, cache_tag)
);

Other Utilities

  • classNames: Cleans and joins an array of inputs with possible undefined or boolean values. Useful for tailwind classnames.
  • getTelLink: Formats a phone number to a tel link.

Types

  • CacheTag: A branded type for cache tags.
  • CacheTagsInvalidateWebhook: The payload of the DatoCMS cache tags invalidate webhook.

Keywords

datocms

FAQs

Package last updated on 13 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts