NPM package name of the public plugin you want to install. For public plugins, that's the only attribute you need to pass.
The name of the plugin. Only to be passed if package name key is not specified.
A description of the plugin. Only to be passed if package name key is not specified.
The entry point URL of the plugin. Only to be passed if package name key is not specified.
Permissions granted to this plugin. Only to be passed if package name key is not specified.
import { buildClient } from "@datocms/cma-client-node";async function run() {// Make sure the API token has access to the CMA, and is stored securelyconst client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });const plugin = await client.plugins.create({package_name: "datocms-plugin-star-rating-editor",});console.log(plugin);}run();
import { buildClient } from "@datocms/cma-client-node";async function run() {// Make sure the API token has access to the CMA, and is stored securelyconst client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });const plugin = await client.plugins.create({name: "5 stars",description: "A better rating experience!",url: "https://cdn.rawgit.com/datocms/extensions/master/samples/five-stars/extension.js",permissions: ["currentUserAccessToken"],});console.log(plugin);}run();