diff --git a/docs/API/core/widget.md b/docs/API/core/widget.md index 1127660b..d6cbd690 100644 --- a/docs/API/core/widget.md +++ b/docs/API/core/widget.md @@ -2,6 +2,22 @@ ## Core widget APIs +### Find widgets for a page + +```js +Fliplet.Widget.find().then(function(instances) { + // Returns all widget instances for a page +}); + +Fliplet.Widget.find({ package: 'com.fiplet.image' }).then(function(instances) { + // Returns all image widget instances for a page +}); + +Fliplet.Widget.findOne({ package: 'com.fiplet.image' }).then(function(instance) { + // Returns the first image widget instance found on a page +}); +``` + ### Get the JSON schema of a widget You can use this method to fetch the JSON schema of a widget. The following widget packages are currently supporting this feature: