Adding an integration
If your project has already been set up but you'd like to add an existing integration (see Integrations), you can do this by following the steps below.
In this example, we'll be adding GraphCMS as our content API.
You can only have 1 API provider per API. For example, you can only use commercetools as the engine for a product API, you can't add another engine.
- Open your
project.yml
file in your/config
folder - Add the below to the
configuration:
section, for example:
content:
engine: graphcms
apiToken: YOUR_TOKEN
projectId: YOUR_PROJECT_ID
region: eu-central-1
stage: master
apiVersion: v2
Each integration has a different configuration setup. Check the article for the integration you want to add for the necessary configuration in your project.yml
.
- Update the
apiToken
,projectId
,region
, andstage
to match your project details, then save the file
You can then access the data in a Frontastic component using the streamType
of content
within the schema.json
, for example:
{
"label": "Stream",
"field": "content",
"type": "stream",
"streamType": "content",
"default": null
},
And then you'll get the content elements from GraphCMS under data.content
.
Updated over 2 years ago