Skip to content

Commit

Permalink
Update Setup and Clarify API Key location
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkal committed Jul 22, 2018
1 parent 955f76b commit 2c3a843
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ public/
.DS_Store
yarn*
*.log
contentful-import-error-log*
.env*
.contentful.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ gatsby new gatsby-starter-gcn https://github.com/ryanwiemer/gatsby-starter-gcn.g

2. `npm run setup`

3. Enter in the requested info for your Contentful space found here: **app.contentful.com****Space Settings****API keys**
3. Enter in the requested info for your Contentful space found here: **app.contentful.com****Space Settings****API keys**. You will need to provide both a standard API key (first tab) and a management key (second tab).

## Customization

Expand Down
16 changes: 8 additions & 8 deletions bin/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ console.log(`
)} API keys`
)}
The ${chalk.green('Content Management API Token')}
will be used to import and write data to your space.
The ${chalk.green('Content Delivery API Token')}
will be used to ship published production-ready content in your Gatsby app.
The ${chalk.green('Content Preview API Token')}
will be used to show not published data in your development environment.
The ${chalk.green('Content Management API Token')}
will be used to import and write data to your space.
Ready? Let's do it! 🎉
`)

Expand All @@ -39,10 +39,6 @@ const questions = [
/^[a-z0-9]{12}$/.test(input) ||
'Space ID must be 12 lowercase characters',
},
{
name: 'managementToken',
message: 'Your Content Management API access token',
},
{
name: 'accessToken',
message: 'Your Content Delivery API access token',
Expand All @@ -51,11 +47,15 @@ const questions = [
name: 'previewToken',
message: 'Your Content Preview API access token',
},
{
name: 'managementToken',
message: 'Your Content Management API access token',
},
]

inquirer
.prompt(questions)
.then(({ spaceId, managementToken, accessToken, previewToken }) => {
.then(({ spaceId, accessToken, previewToken, managementToken }) => {
console.log('Writing config file...')
const configFilePath = path.resolve(__dirname, '..', '.contentful.json')
writeFileSync(
Expand Down

0 comments on commit 2c3a843

Please sign in to comment.