Skip to content
JavaScript library for Contentful's Delivery API (node & browser)
JavaScript CSS Shell
Failed to load latest commit information.
bin docs: Publish a latest dir with latest version of docs
jsdoc-template docs: Bring docs styling closer to official Contentful styling
lib refactor: Removed type-check
test refactor: Replace flow with type-check and docs
vendor-browser chore(vendor): Vendorize axios with separate node/browser builds
vendor-node chore(vendor): Vendorize axios with separate node/browser builds
.babelrc refactor: Replace flow with type-check and docs
.flowconfig feat(links): Allow link resolving to be turned off
.gitignore docs: Setup docs publishing to github
.istanbul.yml test(istanbul): Ignore vendored files
.travis.yml chore(build): Reorder node build versions
CONTRIBUTING.md docs: Update CONTRIBUTING.md
README.md docs(README): Improve supported environments
SETUP.md fix(dependencies): Add follow redirects as a dependency
browser.js fix: Don't get version from package.json on browser build
index.js chore(vendor): Vendorize axios with separate node/browser builds
jsdoc.json docs: Setup jsdoc with config file and temporary readme
karma.base.conf.js fix: Don't get version from package.json on browser build
karma.conf.local.js test(tests): Setup karma browser tests, local and remote
karma.conf.saucelabs.js test(ci): Increase concurrency for saucelabs
migration_from_2_x.md docs: Rework README, add CONTRIBUTING guidelines
package.json refactor: Removed type-check
reference_docs_index.md docs: Update readme for reference docs
version.js refactor: Removed type-check
webpack.config.js fix(build): Fix issue with axios replacement in browser build

README.md

contentful.js

npm Build Status Coverage Status Dependency Status devDependency Status

semantic-release js-standard-style

Javascript SDK for Contentful's Content Delivery API.

About

Contentful is a content management platform for web applications, mobile apps and connected devices. It allows you to create, edit & manage content in the cloud and publish it anywhere via a powerful API. Contentful offers tools for managing editorial teams and enabling cooperation between organizations.

Features

Supported environments

Browsers and Node.js:

  • Chrome
  • Firefox
  • IE11 / Edge
  • Safari
  • node.js (0.10, iojs-3.x, 4.x, 5.x)

Other browsers should also work, but at the moment we're only running automated tests on the browsers and Node.js versions specified above.

Getting started

In order to get started with the Contentful JS SDK you'll need not only to install it, but also to get credentials which will allow you to have access to your content in Contentful.

Installation

In node, using npm:

npm install contentful

Or, if you'd like to use a standalone built file you can use the following script tag or just download it from npmcdn, under the browser-dist directory:

<script src="https://npmcdn.com/contentful@latest/browser-dist/contentful.min.js"></script>

Using contentful@latest will always get you the latest version, but you can also specify a specific version number:

<script src="https://npmcdn.com/contentful@3.0.0/browser-dist/contentful.min.js"></script>

Authentication

To get content from Contentful, an app should authenticate with an with an OAuth bearer token.

You can create API keys using Contentful's web interface. Go to the app, open the space that you want to access (top left corner lists all the spaces), and navigate to the APIs area. Open the API Keys section and create your first token. Done.

Don't forget to also get your Space ID.

For more information, check the Contentful's REST API reference on Authentication.

Documentation/References

Versioning

This project strictly follows Semantic Versioning by use of semantic-release.

This means that new versions are released automatically as fixes, features or breaking changes are released.

You can check the changelog on the releases page.

Migration from contentful.js 2.x and older

contentful.js 3.x was a major rewrite, with some API changes. While the base functionality remains the same, some method names have changed, as well as some internal behaviors.

See the migration guide for more information.

Support

Please open an issue

Contributing

See CONTRIBUTING.md

License

MIT

Something went wrong with that request. Please try again.