Every time we attend a Meetup or speak at a conference and the topic of content management systems comes up, we hear the same thing time and time again.
“I don’t want to deal with that stuff.”
Before we go any further, it’s important to clarify what you’ll be getting with Contentful. Through our content platform, you’ll be able to enable developers to fetch any type of digital content with API calls, while offering editors a familiar-looking web app for creating and managing content. Unlike a CMS, we give you freedom to create your own content model, which allows you to define the data structures you need. From there, we provide you with RESTful APIs so you can deliver content across multiple channels—from websites and mobile apps to IoT, virtual reality games, or anything else you can imagine.
Now, let’s see what this looks like. To get the Content Delivery API (CDA) SDK, you have two options. You can install the npm package and import it into your code:
Then, you can work with the following code snippet to fetch content from Contentful:
That’s it! You can try and change the preceding example on Runkit or learn more about the entire process, including details about linked entries and retrieving through search parameters, through our getting started tutorial.
Along with providing true separation between content and presentation, there’s another aspect that draws in front-end developers to Contentful: the Images API.
Our Images API allows the retrieval and manipulation of image files references from assets. Once you retrieve an unmodified image, you can then resize and crop it, change its background color, and convert it to different formats just by appending a query parameter. Shipping responsive images in the correct size using our API helps you deliver exactly what you need and save data on the wire in the process.
For even more details on what is possible, read the reference documentation for the Images API.
Contentful is designed to get you up and running within minutes. You can create and deploy a project that fetches data from a Node.js server-side in just five minutes. We also have a number of Node.js backend tutorials to help you take your first steps.
To get you started, we set you up with a demo project based on Contentful’s ‘Product Catalogue’ template so you can see it for yourself. Once you have Node installed, just run the following commands: