Thursday, April 10, 2008

Write a collaborative gadget with one line of code

Posted by Jeff Regan, Engineer

We've launched a new feature for iGoogle that allows people to use a gadget collaboratively, similar to Google Docs. Its now possible for multiple instances of a gadget - on the home pages of different users - to access the same user-preference data, the part of the gadget state that is hosted by iGoogle.

We've enabled this for an initial set of existing gadgets where it makes sense - see the post on the Google Blog.

If you think it makes sense for your gadget, just add this line to your the ModulePrefs section of your gadget:

<optional feature="shareable-prefs">

This line tells iGoogle to present a new sharing UI for the gadget, prompting the user to specify friends to share data with and whether the friends should have read-only or write access to the shared data. The UI also offers the user a means to see who they are sharing the gadget with and modify access rights.

Its a simple sharing model - last write wins, and a reload is required to see changes made by others. We look forward to seeing new collaborative gadgets that take advantage of this feature, and we can always make it better - with your feedback.