Components
const url = 'http://localhost:3000/api/v1/components';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:3000/api/v1/components \ --header 'Authorization: Bearer <token>'Every component the project’s Storybooks show now, at its current version: one per Storybook title, read from the index.json of each Storybook deployed to a site, with a new version whenever a deploy changes it.
Scope: read.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Components
object
object
Storybook’s id for it, e.g. ui-button
Its Storybook title, e.g. UI/Button
Its first story’s id
Its stories’ names, in order
Its stories’ and source files, as Storybook’s index.json names them
Where its Storybook is mounted on the site
Who deployed the build it came in
Current: in the live build; replaced: a newer version is; archived: gone from it
object
Its story alone (Storybook’s iframe.html), on the site’s own address; null once no kept build holds it
Its story in Storybook’s own UI
Its address without @n: in artbucket.site.json, the version current when the build is made
How many versions it has had
Example
{ "data": [ { "status": "draft" } ]}default
Section titled “default”An error
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": "example" }}