Contentstack provides a JavaScript Marketplace SDK (that uses Content Marketplace APIs) that developers can use to manage the content of your Contentstack account.
It houses third-party integrations, UI extensions (such as dashboard, sidebar, custom field, and RTE plugins), and other tools that you can plug into Contentstack at the stack as well as organizational level.
Here is an example of how you can start working with Contentstack JavaScript Marketplace SDK.
To initialize the SDK and import its library into your system, execute the following command:
import contentstack from '@contentstack/marketplace-sdk'Next, log in to Contentstack via client using either an authtoken, authorization token, or your email and password.
To do so, execute the following command:
const client = contentstack.client({ authtoken: 'TOKEN'});
// OR
const client = contentstack.client({ authorization: 'TOKEN'});
// OR
const client = contentstack.client();
client.login({ email: ‘your@email.com’, password: ‘your_pwd’ });Once you have access to the client instance, you can execute any Marketplace query.
For example, to retrieve details for an app, execute the following command and enter the UID of the app.
client.marketplace('organization_uid').app('manifest_uid').fetch()
.then((app) => console.log(app))