url
process.env.STRAPI_URL || http://localhost:1337
URL of the Strapi server.
Environment variable STRAPI_URL
can be used to override url
.
entities
[]
You can specify the entities present in your API. Doing so will define the entities as properties in $strapi
so you can access it:
export default {
strapi: {
entities: ['products']
}
}
Then you can use $strapi.products
in your application:
await this.$strapi.$products.find()
Entities can also be defined as objects to specify the content type.
name
String
type
String
collection
'collection' || 'single'
Example
export default {
strapi: {
entities: [
{ name: 'homepage', type: 'single' }
]
}
}
Check out the Strapi documentation on API endpoints.
See more in Usage.
key
String
'strapi_jwt'
Key used for the cookie name as well as localStorage/sessionStorage key.
export default {
strapi: {
key: 'userJwt'
}
}
expires
String
or Number
or 'session'
'session'
When expires === 'session'
, the sessionStorage will be used to act like the cookie.
Otherwise, if the value is a string, it will be parsed using ms, ex: expires: '7d'
A number can also be provided as milliseconds, ex: expires: 7 * 24 * 3600 * 1000
export default {
strapi: {
expires: '31d'
}
}
cookie
Object
{}
Options to forward to the cookie#options module, the expires
property will be overwritten.
export default {
strapi: {
cookie: {
sameSite: 'lax'
}
}
}