Cosmic JS Changelog

Follow the changelog for product updates and feature roll-outs.

Customize REST API Response, Object Metafields Search


We've got a couple updates to make editing and integrating your Cosmic-powered content faster and easier.

1. Customize API Response Data
You can now add a query parameter (props) to the REST API (or NPM module) to limit the response data to only selected properties. Think of this like GraphQL-ifying your REST response to get only the data you need.

For example here's the old way to get Objects from the REST API which gives you everything:

https://api.cosmicjs.com/v1/simple-react-blog/objects?pretty=true&hide_metafields=true&type=posts&limit=20

And now the same query with added props query parameter.

https://api.cosmicjs.com/v1/simple-react-blog/objects?pretty=true&hide_metafields=true&type=posts&limit=20&props=slug,title,content

As you can see, adding props to your query makes your response much more concise giving you only the data you need. This should make your API responses faster, giving you and your end users a better experience 😎

Note: You can also add metadata.your_key to get selected metadata values (limited to one level only).

We've also updated the "Developer Tools" modal in the Dashboard to check out what this looks like:


UPDATE: 9/10/2019
You can also limit the depth of your response data by adding the query param depth. This will limit the nested depth of Object Metafields.

Check out the updated REST API docs for more info.


2. Search Objects in Object Metafields
One of our most popular features is the ability to connect Objects to each other to create relationships. For example: Blog Posts may need to connect to Categories and Authors which you can accomplish using Object Relationship Metafields.

It's now much easier to find the Object you're looking for with a new search feature on the Object Select modal. Simply type in a keyword to quickly find the Objects you need. Gif below:

Updates to Scheduled Publishing


We have a quick update to scheduled publishing that should make things easier for those using this handy feature.

How scheduled publishing used to work:

You set your scheduled publish day and time and it sets your content to draft. This was fine for new content, but not ideal for already published content. If you wanted to maintain your published content and save a new draft for later scheduled update this didn't work.

The new way:
You can now save a published version AND save a draft version scheduled for later publish. This also makes it possible to keep two versions running: 1) Your published content and 2) your draft content scheduled for publish later.

I hope you like this update to scheduled publishing. This update was shipped in direct response to a user that needed a better experience with this feature.

If you have any questions or update that you would like to see shipped, please reach out to us on Twitter and join the conversation on Slack.

Edit Object Metafields


You can now edit specific Metafields on existing Objects via the API. The following API method allows you to edit specific Metafields identified by key, without affecting other Metafields as well as add new Metafields. View in the docs.

The endpoint is:

PATCH https://api.cosmicjs.com/v1/:bucket_slug/edit-object-metafields

Body properties:

slug (String)
metafields (Array)


The Cosmic JS NPM module is also updated (3.2.19) to allow for this capability with the new method:

bucket.editObjectMetafields()

Further directions are available in the Metafields section in the REST API documentation.


Let me know if you have any questions. Join us on Slack and on Twitter.

Updates: New Webhook Event, Delete all Objects in Type, Export Options


New Webhook Event
We have added a new webhook event:

object.edited.unpublished

If you relied on "object.edited.draft" for this event, you will need to edit your webhook to this event. Find your webhooks in Bucket Settings > Webhooks. Be sure to check this out in the Webhooks documentation.


Delete all Objects in your Object Type
This experience has been improved: now when you delete an Object Type it will remove all Objects in this type.


Export Options
You can now export specific Object Types and omit others in your Bucket Export area located in Bucket Settings > Import / Export.

Cosmic JS API now powered by Fastly


We're excited to announce that all Cosmic JS API endpoints (REST and GraphQL) are now powered by the Fastly global CDN. You should now notice huge performance gains on your Bucket API endpoints. For example, if a large endpoint used to take 400ms it is now clocking in under 20ms!

What is Fastly?
Fastly is the leading global CDN cache layer provider that powers some of the most highly-trafficked websites on the internet. The New York Times, Airbnb, and more choose Fastly because of their global CDN of over 60 high-powered point of presence servers (POPs). These POPs are distributed closest to your users so they can get your content as fast as possible. This also shields your cached content from any issues caused by the origin infrastructure.

From the Fastly Network Map page, "we’ve focused our efforts on placing fewer, more powerful POPs at strategic locations around the world."



What does this mean for you?
We're happy to roll this out to all Cosmic JS users. Your Cosmic JS content is now automatically powered by the Fastly global CDN and available to your users world-wide. No extra work needs to be done on your part. Just sit back and notice huge performance gains for you and your users 😎 

And more great news: requests to the cache-served content from the Cosmic JS API will not count towards your API request limits on your billing plan. API requests are counted only on initial requests to any resource after you clear your cache either manually in Bucket > Settings or by adding, editing, or deleting content in your Bucket.

It's our mission to make sure your team has the best experience collaborating on content using Cosmic JS. With the Cosmic JS Fastly update, you can deliver great content and experiences to your world-wide customers even faster.

If you have any questions, reach out to us on Twitter and join the Slack community.

Duplicate Object Types, Editor Publishing Restrictions


We have a couple new feature releases for your review:

Duplicate Object Types
You can now Duplicate Object Types. Go to any Object Type > Settings page and scroll to the bottom and find the "Duplicate Objects Type" button. This is a great time saver for when you need to duplicate Object Type Metafield content models and settings (it does not duplicate Objects).


Editor Restricted Publishing
You can now assign a team member access to all content in your Bucket but only allow them to save content to draft. This is a nice in-between role between Editor and Contributor.

Headless CMS Features and Solution Pages


We're excited to launch new resources to demonstrate how teams all over the world are using the Cosmic JS headless CMS to manage content for their websites and apps. You'll now notice:

  1. The Navigation Bar has grown to include a new Solutions Tab, which outlines use-cases like E-Commerce Websites, Blogs, Native Apps and more. Each Solution page provides helpful open-source example apps, extensions and customer stories that demonstrate that particular use-case.
  2. All Cosmic JS Headless CMS Features now have a Feature Detail Page for easier adoption and reference among teams. See example: Revision History.

Sign up / Log in with Google


We're excited to announce a new way to sign up and log in with Cosmic JS: using your Google account. It just takes 2 clicks 😎 


Authenticating with your Google account comes in addition to the existing options of using GitHub, Single Sign-On or manual account creation. We hope this makes your team's onboarding experience frictionless and easy.

Log in or sign up to check it out.


If you have any questions, or any other feature requests (the squeaky wheel gets the grease!) reach out to us on Slack and join us on Twitter.   

Dashboard Updates


Here's a quick update on some nice improvements to the Cosmic JS Dashboard, accompanied by gifs for your viewing pleasure 😁 

1. Easier Integration Tools
We are committed to a world-class developer experience. It's our goal to make it as easy as possible to integrate Cosmic JS content into any application. And now the experience is even better because with this new Integration Tools modal update, you have instant access to the API response for any dashboard resource in your Bucket. You also have easy access to all the other available integration methods: GraphQL API, NPM Module, and more. 

Just click the "Integration Tools" button to see the magic in action.

The high standard for an easy integration experience is Stripe. And we are aiming to make it even easier than Stripe to integrate your Cosmic JS code into your app. That's right, I said it, and you can hold me to it 😜 

2. Remove File Metafields
You can now remove files from File Metafields. This is a feature that falls in the category of "why wasn't this shipped earlier?", but here it is, better late than never.


We hope you like these improvements to get you up and running with cloud-powered content faster and easier. If you have any questions, or any other feature requests (the squeaky wheel gets the grease!) reach out to us on Slack and join us on Twitter


Photo by Chris Liverani on Unsplash