Configuration API
- default
json
{
"shared": {},
"builds": [],
"hooks": {}
}{
"shared": {},
"builds": [],
"hooks": {}
}shared
- type:
object
default values between all builds
- example
json
{
"headers": {
"X-Powered-By": "Strapi CMS"
}
}{
"headers": {
"X-Powered-By": "Strapi CMS"
}
}headers
- type:
functionorobject - arguments:
{ record } - description: The default headers to be sent with the request for all builds. Any build specific headers with the same nproperty ame will override these. A record is only provided to the function for event triggers.
params
- type:
functionorobject - arguments:
{ record } - description: The default parameters to be sent with the request for all builds. Any build specific params with the same property name will override these. A record is only provided to the function for event triggers.
build
- type
array
build configurations
name
- type:
string - description: The name for the build. MUST BE UNIQUE.
url
- type:
string - description: The url for the build.
trigger
type:
objectdescription: The trigger configuration for the build.
type
- type:
string - description: The trigger type for the build. It can be
manual,cron, orevent.
- type:
expression
- type:
string - description: The cron expression to use for the
crontigger type. Required for thecrontrigger type only.
- type:
events
type:
arraydescription: The events to trigger new build on. Required for the
eventtrigger type only.uid
- type:
string - description: The uid of the content type to watch mutations on.
- type:
actions
- type:
actions - description: The actions/mutations to listen for on the content type. Possible values are
create,update,delete,publish,unpublish.publishandunpublishare only available on content types, not media mutations.
- type:
method
- type:
string - default:
POST - description: The method to use for the request that triggers the build. Supported methods are
GETandPOST.
headers
- type:
functionorobject - arguments:
{ record } - description: The headers to be sent with the request. A record is only provided to the function for event triggers.
- example
js
{
headers: () => ({
'X-Powered-By': 'Lorem Ipsum',
});
}{
headers: () => ({
'X-Powered-By': 'Lorem Ipsum',
});
}js
{
headers: {
'X-Powered-By': 'Lorem Ipsum',
};
}{
headers: {
'X-Powered-By': 'Lorem Ipsum',
};
}params
- type:
functionorobject - arguments:
{ record } - description: The parameters to be sent with the request. A record is only provided to the function for event triggers.
- example
js
{
params: () => ({
lorem: 'ipsum',
});
}{
params: () => ({
lorem: 'ipsum',
});
}js
{
params: {
'lorem': 'ipsum',
};
}{
params: {
'lorem': 'ipsum',
};
}body
- type:
functionorobject - arguments:
{ record } - description: The parameters to be sent with the request. A record is only provided to the function for event triggers.
- example
js
{
body: () => ({
lorem: 'ipsum',
});
}{
body: () => ({
lorem: 'ipsum',
});
}js
{
body: {
'lorem': 'ipsum',
};
}{
body: {
'lorem': 'ipsum',
};
}hooks
- type:
object
hook into specific areas to extend functionality
beforeRequest
- type:
function - arguments:
requestConfig - description: Mutate the request before it is sent out
- example
js
{
hooks: {
beforeRequest: (requestConfig) => {
requestConfig.headers.custom = 'custom_value';
return config;
};
}
}{
hooks: {
beforeRequest: (requestConfig) => {
requestConfig.headers.custom = 'custom_value';
return config;
};
}
}