Community Articles How to Share Object Schemas in Cosmic JS

How to Share Object Schemas in Cosmic JS

An Object in Cosmic JS can be a page, a blog post, an author or anything you want it to be. Cosmic JS gives you the freedom to create and manage content openly and create your own data structure. Each Object allows for the creation of a title, slug, content and Metafields. Metafields are very powerful pieces of custom data that can be added to objects that can be recursively nested. 

Depending on your use case, your Objects' Content Models can become quite robust with metafields. Save time creating new Objects with sharable Object Schemas. Cosmic JS makes sharing Object Schemas easy. Simply follow these steps: 


How to Share Object Schemas in Cosmic JS

1. Click "View Schema" on an existing Object and copy the code in the text area.


2. Paste into the Schema area in a new or existing Object.


Make sure that your Schema is a valid JSON Object structure. For example:

{
  "title": "Object Title",
  "content": "

Here is some amazing content.", "metafields": [ { "title": "Headline", "key": "headline", "value": "Amazing Headline", "type": "text" } ] }

This is another great example of Cosmic JS helping blended teams of developers and content editors build apps faster. With Cosmic JS, write once and deliver everywhere. 

I hope that you've found this tutorial helpful. If you have questions or comments about Content Editor Features in the Cosmic JS system, I'd love to hear about them. You can refer to my Cosmic JS Profile for additional content on how to intuitively navigate the Cosmic JS Dashboard. 

carson@cosmicjs.com 

Was this article helpful?

Thank you! Your input helps us improve our articles and resources. If you have any other questions or comments, please contact support.

You may also like


This article will point out some of the advantages that a headless CMS offers. Hopefully, your pain point is covered in here or it sparks an idea for a new way of thinking about what you can do with a CMS.
Thanks to everyone in Dallas who came out to the Vuetiful Holiday Meetup at Simple Media, featuring Vuetify, Netlify and Cosmic JS. 🎉
In this tutorial I'm going to show you how to create a "Tutorials Portfolio" app using a Nuxt.js, and Cosmic JS.
We recently built the Story Licensing application using some of the most powerful development tools available.
This is a quick example to show some of the powerful things you can do with the Cosmic JS NPM Module. This script will, add a Bucket to your Cosmic JS account, add an Object Type (Pages) and add a few Pages.
The beauty of using a static site generator is that your backend can be completely separate. In this video, I switch from markdown files to Cosmic JS!

Ready to Get Started?

No payment info required.
Start Now   Contact Sales