Skip to content

Commit e7f983c

Browse files
committed
fix: Add instructions on how to use the preview API
1 parent 0d49de6 commit e7f983c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,20 @@ client.getEntry('5PeGS2SoZGSa4GuiQsigQu')
8787

8888
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.
8989

90+
## Using this SDK with the Preview API
91+
92+
This SDK can also be used with the Preview API. In order to do so, you need to use the Preview API Access token, available on the same page where you get the Delivery API token, and specify the host of the preview API, such as:
93+
94+
```js
95+
var client = contentful.createClient({
96+
space: 'developer_bookshelf',
97+
accessToken: 'preview_0b7f6x59a0',
98+
host: 'preview.contentful.com'
99+
})
100+
```
101+
102+
You can check other options for the client on our reference documentation
103+
90104
## Documentation/References
91105

92106
To help you get the most out of this SDK, we've prepared reference documentation, tutorials and other examples that will help you learn and understand how to use this library.

0 commit comments

Comments
 (0)