Skip to content

Commit 8416561

Browse files
committed
fix: Improve README
1 parent 1a3933a commit 8416561

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,38 @@ Don't forget to also get your Space ID.
7070

7171
For more information, check the Contentful's REST API reference on [Authentication](https://www.contentful.com/developers/docs/references/authentication/).
7272

73+
## Your first request
74+
75+
The following code snippet is the most basic one you can use to get some content from Contentful with this SDK:
76+
77+
```js
78+
var contentful = require('contentful')
79+
var client = contentful.createClient({
80+
// This is the space ID. A space is like a project folder in Contentful terms
81+
space: 'developer_bookshelf',
82+
// This is the access token for this space. Normally you get both ID and the token in the Contentful web app
83+
accessToken: '0b7f6x59a0'
84+
})
85+
// This API call will request an entry with the specified ID from the space defined at the top, using a space-specific access token.
86+
client.getEntry('5PeGS2SoZGSa4GuiQsigQu')
87+
.then((entry) => console.log(entry))
88+
```
89+
90+
You can try and change the above example at [Tonic](https://tonicdev.com/npm/contentful), or if you'd prefer a more Browser oriented example, check out this [JSFiddle](https://jsfiddle.net/contentful/kefaj4s8/) version of our Product Catalogue demo app.
91+
7392
## Documentation/References
7493

94+
In order to do more with this SDK, have a look at the various documentation links below:
95+
7596
* [Contentful's JS SDK reference](https://contentful.github.io/contentful.js)
7697
* From version 3.0.0 onwards, you can access documentation for a specific version by visiting `https://contentful.github.io/contentful.js/contentful/<VERSION>`
77-
* For versions prior to 3.0.0, you can access documentation at [https://github.com/contentful/contentful.js/tree/legacy](https://github.com/contentful/contentful.js/tree/legacy)
7898
* Check the [Contentful for JavaScript](https://www.contentful.com/developers/docs/javascript/) page for Tutorials, Demo Apps, and more information on other ways of using JavaScript with Contentful
7999
* [Contentful's CDA REST API reference](https://www.contentful.com/developers/docs/references/content-delivery-api/) for additional details on the Delivery API
80100

101+
### Legacy contentful.js
102+
103+
For versions prior to 3.0.0, you can access documentation at [https://github.com/contentful/contentful.js/tree/legacy](https://github.com/contentful/contentful.js/tree/legacy)
104+
81105
## Versioning
82106

83107
This project strictly follows [Semantic Versioning](http://semver.org/) by use of [semantic-release](https://github.com/semantic-release/semantic-release).
@@ -94,7 +118,9 @@ See the [migration guide](migration_from_2_x.md) for more information.
94118

95119
## Support
96120

97-
Please open an [issue](https://github.com/contentful/contentful.js/issues/new)
121+
If you have a problem with this library, please file an [issue](https://github.com/contentful/contentful.js/issues/new) here on Github.
122+
123+
If you have other problems with Contentful not related to this library, you can contact [Customer Support](https://support.contentful.com).
98124

99125
## Contributing
100126

0 commit comments

Comments
 (0)