@contentstack/marketplace-sdk

中文文档
1.5.4发布于 2026/06/29MITTypeScriptCommonJS近 30 天下载 4.9万

The Contentstack Marketplace SDK is used to manage the content of your Contentstack marketplace apps

原始使用文档
文档目录10 节
  1. Contentstack Marketplace SDK
  2. Prerequisite
  3. Installation
  4. Authentication
  5. Authtoken
  6. Login
  7. OAuth Token
  8. Contentstack Marketplace SDK: 5-minute Quickstart
  9. Helpful Links
  10. The MIT License (MIT)

Contentstack

Contentstack Marketplace SDK

Contentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful cross-platform applications in their favorite languages. All you have to do is build your application frontend, and Contentstack will take care of the rest. Read More.

The new Contentstack Marketplace serves as a one-stop shop for all of your integration requirements. It's where you'll find pre-built apps, starters, tutorials, and everything you'll need to create a fully customized digital experience stack. This SDK helps in managing marketplace related operations.

Prerequisite

You need Node.js version 10 or above installed on your machine to use the Contentstack Marketplace SDK.

Installation

Node

Install it via npm:

npm i @contentstack/marketplace-sdk

To import the SDK, use the following command:

import contentstack from ‘@contentstack/marketplace-sdk’

contentstackClient = contentstack.client()

Authentication

To use this SDK, you need to authenticate your users by using the Authtoken, credentials, or Management Token (stack-level token).

Authtoken

An Authtoken is a read-write token used to make authorized CMA requests, and it is a user-specific token.

contentstackClient = contentstack.client({ authtoken: 'AUTHTOKEN' })

Login

To Login to Contentstack by using credentials, you can use the following lines of code:

contentstackClient.login({ email: 'EMAIL', password: 'PASSWORD'})

OAuth Token

Contentstack OAuth uses the OAuth 2.0 protocol that allows external applications and services to access Contentstack APIs on behalf of a user.

contentstackClient = contentstack.client({ authorization: 'OAUTH_TOKEN' })

Contentstack Marketplace SDK: 5-minute Quickstart

Initializing Your SDK:

To use the Marketplace SDK, you need to first initialize it. To do this, use the following code:

import contentstack from ‘@contentstack/marketplace-sdk’

const contentstackClient = contentstack.client({ authtoken: 'AUTHTOKEN' })

Find All Marketplace Apps

To retrieve the details of all the apps in your Contentstack organization, execute the following code:

import * as contentstack from '@contentstack/marketplace-sdk'

const client = contentstack.client({ authtoken: 'TOKEN'})

client.marketplace('organization_uid')
    .findAllApps()
    .then((collection) => {
        console.log(collection)
    })

Fetch single app details

To retrieve the details of a particular app, execute the following code:

import * as contentstack from '@contentstack/marketplace-sdk'
const client = contentstack.client({ authtoken: 'TOKEN'})

client.marketplace('organization_uid')
    .app('manifest_uid')
    .fetch()
    .then((app) => console.log(app))

Create a new app

To create a new app/manifest in your Contentstack organization, execute the following code:

import * as contentstack from '@contentstack/marketplace-sdk'
const client = contentstack.client({ authtoken: 'TOKEN'})
const app = {
 name: 'APP_NAME',
 description: 'APP_DESCRIPTION',
 target_type: 'stack'/'organization',
 webhook: // optional
  {
    target_url: 'TARGET_URL',
    channel: 'CHANNEL'
  },
 oauth: // optional
  {
    redirect_uri: 'REDIRECT_URI',
    enabled: true,
  }
}

client.marketplace('organization_uid')
    .app()
    .create(app)
    .then((app) => console.log(app))

The MIT License (MIT)

Copyright © 2012-2024 Contentstack. All Rights Reserved

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

版本与发布记录

@contentstack/marketplace-sdk 共发布 24 个版本,首次发布于 2023/10/18;过去 12 个月发布了 7 个版本。

版本发布日期距今
1.5.4latest2026/06/294 个月前
1.5.32026/06/085 个月前
1.5.22026/05/046 个月前
1.5.12026/04/156 个月前
1.5.02026/02/029 个月前
1.4.22026/01/199 个月前

关于 @contentstack/marketplace-sdk 的常见问题

@contentstack/marketplace-sdk 是什么?

The Contentstack Marketplace SDK is used to manage the content of your Contentstack marketplace apps

如何安装 @contentstack/marketplace-sdk?

在项目目录运行 npm install @contentstack/marketplace-sdk,或使用 pnpm add / yarn add / bun add。

@contentstack/marketplace-sdk 支持 TypeScript 吗?

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

@contentstack/marketplace-sdk 支持 ESM 还是 CommonJS?

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

@contentstack/marketplace-sdk 可以商用吗?

@contentstack/marketplace-sdk 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@contentstack/marketplace-sdk 的下载量有多少?

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

@contentstack/marketplace-sdk 还在维护吗?

最新版本 1.5.4 发布于 2026/06/29(4 个月前);至今共发布 24 个版本,其中过去 12 个月发布了 7 个;首次发布于 2023/10/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。