@contentchef/contentchef-management-js-client

中文文档
11.2.0-alpha.9发布于 2026/11/10UNLICENSEDTypeScriptCommonJS近 30 天下载 2701

ContentChef authoring+release javascript client

原始使用文档
文档目录3 节
  1. Installing
  2. Examples
  3. Docs

ContentChef Management JS Client

Installing

Using npm:

    $ npm install @contentchef/contentchef-management-js-client

Using yarn:

    $ yarn add @contentchef/contentchef-management-js-client

Examples

  • Configuration example This code will show how to correctly configure your ContentChef Management JS Client
    class ContentChefApi {
        api: ContentChefClient;

        // The token is the authorizer that is needed to make actions in your space, for security problems the operation of setting the token
        // should me make in a server side application
        apiTokenResolver: AuthenticationTokenResolver = {
                getToken: async () => {
                   return await 'do stuffs to retrieve your api token';
                }
            };
            
        spaceIdResolver: SpaceIdResolver = {
            getSpaceId: async () => {
                return await 'do Stuff to retrieve your space id';
            }
        };

        initializeClient = () => {
            this.api = createChefSpaceClient(apiTokenResolver, spaceIdResolver, { apiRoot: 'https://mgmt.contentchef.io' });
        }
    }

    // We do this to create a singleton of the client
    export const contentChefApi = new ContentChefApi().initializeClient();
  • Usage example This code will show how to correctly use your ContentChef Management JS Client after the initial configuration
    class ContentChefContentStore {
        api: ContentChefClient;

        constructor (chefApi: ContentChefClient) {
            this.api = chefApi
        }
    
        async getContent (reqParams: GetContentRequest) {
            try {
                const response = await this.api.contents.get(reqParam);
                console.log('This is the requested content');
                console.log(response);
            } catch (e) {
               console.log(`An error occurred retrieving the content with id ${reqParams.id}`);
               console.log(e); 
            } 
        }

    }

Docs

To generate a new Documentation simply run the command

Using yarn:

    $ yarn generate-docs

A new documentation will be created inside the folder docs in the root of the project, then simply serve the index.html file inside the docs folder in your browser

版本与发布记录

@contentchef/contentchef-management-js-client 共发布 88 个版本,首次发布于 2020/06/23;过去 12 个月发布了 52 个版本。

版本发布日期距今
11.2.0-alpha.9latest2026/11/10今天
11.2.0-11.2.0-alpha.8.02026/11/10今天
11.2.0-alpha.82026/11/056 天前
11.2.0-alpha.72026/11/046 天前
11.2.0-alpha.62026/11/038 天前
11.2.0-alpha.52026/11/038 天前

关于 @contentchef/contentchef-management-js-client 的常见问题

@contentchef/contentchef-management-js-client 是什么?

ContentChef authoring+release javascript client

如何安装 @contentchef/contentchef-management-js-client?

在项目目录运行 npm install @contentchef/contentchef-management-js-client,或使用 pnpm add / yarn add / bun add。

@contentchef/contentchef-management-js-client 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@contentchef/contentchef-management-js-client 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@contentchef/contentchef-management-js-client 可以商用吗?

@contentchef/contentchef-management-js-client 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@contentchef/contentchef-management-js-client 的下载量有多少?

根据 npm 官方下载统计,@contentchef/contentchef-management-js-client 在 2026/10/11 – 2026/11/09 这 30 天内被下载 2,701 次,日均约 90 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@contentchef/contentchef-management-js-client 还在维护吗?

最新版本 11.2.0-alpha.9 发布于 2026/11/10(今天);至今共发布 88 个版本,其中过去 12 个月发布了 52 个;首次发布于 2020/06/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。