# @hashicorp/platform-cms

> CMS utilities for HashiCorp next.js websites

Latest version **0.4.0** (published 2023-04-26) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install @hashicorp/platform-cms
pnpm add @hashicorp/platform-cms
yarn add @hashicorp/platform-cms
bun add @hashicorp/platform-cms
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2023-04-26 |
| First published | 2021-06-21 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | HashiCorp |
| Maintainers | alexju, consul-ui-services, wenincode-hashicorp, hashicb, britt.lindgren, paulhcp, nandereck, tstormk, hashibot-hds, lackeyjb1, alexcarpenter, youriwims, jpogran, ashleemboyer, _natmegs, thrashr888, amyrlam, melsumner, mwickett, didoo, zchsh, brandonromano, hcitsec, gregone, meirish, enmod, kylemac, kaxcode, anubhavmishra-hashicorp, hashibot-web, cstitt-hashi, bkalow, kstraut, mocohen, dhaulagiri |

## Links

- npm: https://www.npmjs.com/package/@hashicorp/platform-cms
- Repository: https://github.com/hashicorp/web-platform-packages
- Homepage: https://github.com/hashicorp/web-platform-packages#readme
- Issues: https://github.com/hashicorp/web-platform-packages/issues
- npm.io page: https://npm.io/package/@hashicorp/platform-cms

## Dependencies (1)

- [rivet-graphql](https://npm.io/package/rivet-graphql.md) ^0.6.0-canary-20230309231927

## Recent versions

- 0.4.0 (latest) — 2023-04-26
- 0.5.0-canary-202447174137 (canary) — 2024-05-07
- 0.4.1-canary-202447172120 — 2024-05-07
- 0.4.1-canary-20244717137 — 2024-05-07
- 0.4.1-canary-20244723359 — 2024-05-07
- 0.4.1-canary-20244723025 — 2024-05-07
- 0.4.1-canary-20244701115 — 2024-05-07
- 0.4.1-canary-202446233551 — 2024-05-06
- 0.5.0-canary-2023513203633 — 2023-06-13
- 0.4.0-canary-202329232746 — 2023-03-09
- 0.4.0-canary-202329232155 — 2023-03-09
- 0.4.0-canary-202329221230 — 2023-03-09
- 0.4.0-canary-20232922320 — 2023-03-09
- 0.4.0-canary-202328185719 — 2023-03-08
- 0.4.0-canary-20232818424 — 2023-03-08
- … 33 more at https://npm.io/package/@hashicorp/platform-cms/versions

## README

# `@hashicorp/platform-cms`

A small set of utilities for working with DatoCMS within nextjs. There are currently two useful utilities in this package:

### Usage

The default import - an instance of [rivet](https://github.com/hashicorp/rivet-graphql) pre-configured with our Dato instance. See the rivet docs for more details on usage. It can generally be used as such within our apps:

```jsx
import rivetQuery from '@hashicorp/platform-cms'
import query from './query.graphql'

function MyComponent({ someProps }) {
  return <>{JSON.stringify(someProps)}</>
}

export async function getStaticProps() {
  const { someProps } = await rivetQuery(query)
  return { someProps }
}
```

### `@hashicorp/platform-cms/config`

Exposes the raw configuration needed to connect to HashiCorp's DatoCMS GraphQL API. Example:

```ts
import { url, headers } from '@hashicorp/platform-cms/config'
```

`url` is the graphql endpoint, and `headers` is an object containing a read-only authorization token needed to fetch data from the API.

It's also worth noting that there is some configurability here (the environent, and the token), if you pass any of the "dato" options in to the `@hashicorp/platform-base` nextjs plugin. It is presumed that you are using both together, since `platform-base` is a default for all of our apps.

---
_Source: https://npm.io/package/@hashicorp/platform-cms · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
