When implementing designs in code, do not rely on screenshots alone. You must fetch the actual HTML code for each screen to ensure accuracy in structure, styling, and content.
Use the following endpoint to retrieve the code:
GET /api/v1/projects/:id/components/:componentId
The componentId is provided in the result.operations field of a chat run.
Best Practice: Component code can be large. To avoid wasting tokens and slowing down the process, do not output the code through text. Instead, use shell commands to fetch the API response and pipe it directly to a file on disk.
# Example of fetching component code via shell to avoid token waste
curl -X GET "https://<api-url>/api/v1/projects/proj_xyz/components/cmp_abc" -H "Authorization: Bearer <token>" > screen_abc.html