kontent-ai / gatsby-packages

Monorepo with Gatsby Kontent packages.
https://www.gatsbyjs.org/plugins/?=%40kentico%2Fkontent-
MIT License
33 stars 24 forks source link

secureApiKey on gatsby-config not work #70

Closed blasiuscosa closed 5 years ago

blasiuscosa commented 5 years ago

Brief bug description

When I had my 'Delivery API secured access' enabled and provided secureApiKey with the Delivery API key

Repro steps

  1. Run gatsby develop
  2. Monitor the terminal
  3. See error

Expected behavior

What the correct behavior is? This should work by generating the node for each content types and content items

Test environment

Additional context

Screenshots

image

Simply007 commented 5 years ago

hello @blasiuscosa,

thanks, for reporting the issue! (I have also checked the Intercom conversation with @giorgioLUK)

This was most probably caused by incorrect links to JavaScript Delivery SDK (caused by the rebranding of Kentico Kontent). I have fixed the readme links in this commit: https://github.com/Kentico/gatsby-source-kentico-cloud/commit/f0264fe3ad2b3b776998b755976a08d36fb5db39

The correct delivery format is described here:

As I see you are using secureApiKey - you should use securedApiKey (with the'd').

I have created a sample under my personal profile:

You could clone is and run:

npm install
npm run develop

There is already set up the sample project with secured API turned on (no sensitive data here :smile:) Check gatsby-config.js.

You could try this for testing for by setting your project ID and secured API key.

Let me know if this helps! If not - feel free to reopen the issue.

blasiuscosa commented 5 years ago

Hi @Simply007,

Thank you for the updates, yes I was looked on the JavaScript Delivery SDK link on readme file. This is really helpful and now it works properly.