The name of the plugin
A description of the plugin
The entry point URL of the plugin
Global plugin configuration. Plugins can persist whatever information they want in this object to reuse it later.
The installed version of the plugin (or null if it's a private plugin)
const { SiteClient } = require("datocms-client");const client = new SiteClient("YOUR-API-TOKEN");const pluginId = '124';client.plugin.update(pluginId, {parameters: { foo: "bar" }}).then((plugin) => {console.log(plugin);}).catch((error) => {console.error(error);});
{"id": "124","name": "5 stars","description": "A simple field editor that allows a nicer editing rating experience","packageName": "datocms-plugin-star-rating-editor","packageVersion": "0.0.4","url": "https://cdn.rawgit.com/datocms/extensions/master/samples/five-stars/extension.js","permissions": ["currentUserAccessToken"],"parameters": { "foo": "bar" }}
const { SiteClient } = require("datocms-client");const client = new SiteClient("YOUR-API-TOKEN");const pluginId = '124';client.plugin.update(pluginId, {packageVersion: "2.0.0",}).then((plugin) => {console.log(plugin);}).catch((error) => {console.error(error);});
{"id": "124","name": "5 stars","description": "A simple field editor that allows a nicer editing rating experience","packageName": "datocms-plugin-star-rating-editor","packageVersion": "2.0.0","url": "https://cdn.rawgit.com/datocms/extensions/master/samples/five-stars/extension.js","permissions": ["currentUserAccessToken"],"parameters": { "foo": "bar" }}
const SiteClient = require('datocms-client').SiteClient;const client = new SiteClient('YOUR-API-TOKEN');client.plugins.create({name: '5 stars',description: 'A simple field editor that allows a nicer editing rating experience',url: 'https://cdn.rawgit.com/datocms/extensions/master/samples/five-stars/extension.js',permissions: ["currentUserAccessToken"],}).then((plugin) => {console.log(plugin);}).catch((error) => {console.error(error);});
{"id": "124","name": "5 stars","description": "A simple field editor that allows a nicer editing rating experience","packageName": null,"packageVersion": null,"url": "https://cdn.rawgit.com/datocms/extensions/master/samples/five-stars/extension.js","permissions": ["currentUserAccessToken"],"parameters": { "foo": "bar" }}