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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@content-sync/content-cloud-cli

v1.0.6

Published

The CLI for automating Content Cloud tasks

Readme

Content Cloud CLI

Use the Content Cloud CLI to auto-generate client code for your Content Cloud space in Content Sync.

Installation

npm install -g @content-sync/content-cloud-cli

Settings

Base URL

The URL of the publisher to connect to. This will depend on the region of your space and can be viewed in the space settings of the Content Sync app. You can use the CC_BASE_URL environment variable to set this or pass a -b / --base-url parameter to your command.

Access token

The access token to use for all requests. This token must have access to the service:publisher API. Permissions depend on the command you want to run. You can use the CC_ACCESS_TOKEN environment variable to set this or pass a -a / --access-token parameter to your command.

The token can include an environment ID that may alter the result of the command. Double check that you are using the correct environment ID e.g. when generating code to receive the correct information.

Commands

Help

Print information about how to use the CLI or a specific command:

# General information
content-cloud help

# Help with the command `generate`
content-cloud help generate

Info

Print basic information about the connected space and token:

# General information about the space and token
content-cloud info

Generate

Below examples save the files at ./app/content-cloud but you can change this to match your project folder structure.

Typescript REST client

content-cloud generate rest typescript -o app/content-cloud

E.g. in your Next.js app, you can use the generated client like this:

import { ContentCloudRestClient } from "@/app/content-cloud/content-cloud-rest-client";

export default async function ContentList() {
  // For public APIs or when providing the access token statically as an environment variable:
  const contentCloud = new ContentCloudRestClient();

  const contentList = await contentCloud.contentCollection({
    // E.g. to filter by content type (good for auto completion and type safety):
    //content_type: "BasicPageContent",
  });

  return (
    <div>
      <h1>Content List</h1>
      {contentList.items.map((content) => (
        <div key={content.sys.id}>
          <h2>{content.sys.name}</h2>
          {content.sys.slug && <p>Maybe add a route for: {content.sys.slug}</p>}
        </div>
      ))}
    </div>
  );
}

With authentication

Never share client secrets with your users or serve it to browsers; only expose the JWTs you are creating to your end users using the client secret.

To generate a JWT and use it to request content, adjust your code like this:

import { ContentCloudPermission, ContentCloudService, generateAccessToken } from "@/app/content-cloud/content-cloud-authentication";
// ...

export default async function ContentList() {
  // For private APIs without a static access token:
  const contentCloud = new ContentCloudRestClient({
    accessToken: generateAccessToken({
        permissions: [
          // The base permission to query content.
          ContentCloudPermission.CONTENT_READ,
          // To download assets and display images.
          ContentCloudPermission.ASSET_READ_FILE,
          // To read and write user data.
          ContentCloudPermission.USER_DATA_READ,
          ContentCloudPermission.USER_DATA_WRITE,
        ],
        // The APIs the user is allowed to access.
        services: [ContentCloudService.LIVE, ContentCloudService.ASSETS],
        // From your auth system, e.g. Auth0.
        userId: 'test-user-id',
        userDataContentTypes: ['*'],
      }),
  });

  //...
}

Typescript GraphQL client

content-cloud generate graphql typescript -o app/content-cloud

GraphQL schema

content-cloud graphql graphql typescript -o app/content-cloud