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.
The following examples are available:
import { buildClient } from '@datocms/cma-client-node';async function run() {const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });const plugin = await client.plugins.create({package_name: 'datocms-plugin-star-rating-editor',});console.log(plugin);}run();
const result = {type: 'plugin',id: '124',name: '5 stars',description: 'A better rating experience!',package_name: 'datocms-plugin-star-rating-editor',package_version: '0.0.4',url: 'https://cdn.rawgit.com/datocms/extensions/master/samples/five-stars/extension.js',permissions: ['currentUserAccessToken'],parameters: {},};
import { buildClient } from '@datocms/cma-client-node';async function run() {const client = buildClient({ apiToken: '<YOUR_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();
const result = {type: 'plugin',id: '124',name: '5 stars',description: 'A better rating experience!',url: 'https://cdn.rawgit.com/datocms/extensions/master/samples/five-stars/extension.js',permissions: ['currentUserAccessToken'],parameters: {},};