Skip to content

Commit f7b0825

Browse files
committed
fix(package): Add tonicdev.com example file
1 parent 0ec6a43 commit f7b0825

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
},
1010
"author": "Contentful <support@contentful.com>",
1111
"license": "MIT",
12+
"tonicExampleFilename": "tonic-example.js",
1213
"scripts": {
1314
"clean": "rimraf dist && rimraf browser-dist && rimraf coverage && rimraf out",
1415
"build": "npm run clean && npm run vendor && npm run build:dist && npm run build:standalone",

tonic-example.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
var contentful = require('contentful')
2+
var client = contentful.createClient({
3+
// This is the space ID. A space is like a project folder in Contentful terms
4+
space: 'developer_bookshelf',
5+
// This is the access token for this space. Normally you get both ID and the token in the Contentful web app
6+
accessToken: '0b7f6x59a0'
7+
})
8+
// This API call will request an entry with the specified ID from the space defined at the top, using a space-specific access token.
9+
await client.getEntry('5PeGS2SoZGSa4GuiQsigQu')

0 commit comments

Comments
 (0)