Tabs
The Tabs Resource is an organizational layer within a Digital Product Passport (DPP). A Tab acts as a container that groups related Cards and Files under a single logical heading, such as "Sustainability," "Certifications," or "Technical Specs."
Methods
list
Retrieves all tabs associated with a specific Digital Product Passport.
Signature
async list(dppId: string, options?: RequestOptions): Promise<Tabs[]>
Parameters
| Parameter | Type | Description |
|---|---|---|
| dppId | string | The unique identifier of the DPP. |
| options | RequestOptions | (Optional) Custom request configuration. |
get
Retrieves the full details of a specific Tab, including all its nested Cards and Files.
Signature
async get(dppId: string, tabId: string, options?: RequestOptions): Promise<Tabs>
Parameters
| Parameter | Type | Description |
|---|---|---|
| dppId | string | The unique identifier of the parent DPP. |
| tabId | string | The unique identifier of the target Tab. |
create
Creates a new Tab and populates it with nested cards and files in a single atomic operation. This is the most efficient way to build out the structure of a DPP.
Signature
async create(
modelId: string,
dppId: string,
tabName: string,
tabCards: CreateCard[],
tabFiles: CreateFile[],
options?: RequestOptions
): Promise<Tabs>
Example
const newTab = await sdk.tabs.create(
"model_123",
"dpp_456",
"Technical Data",
[
{
name: "Dimensions",
characteristics: [{ name: "Weight", description: "500g" }]
}
],
[
{ name: "Manual", file: myFileBlob, description: "User guide" }
]
);
update
Updates an existing Tab's metadata and its nested content.
[!TIP] Partial Updates & Upserts: This method supports intelligent updates. If you pass an object with an
id, the SDK updates the existing record. If you omit theid, the SDK creates a new Card or File within the tab.
Signature
async update(
modelId: string,
dppId: string,
tabId: string,
tabName: string,
tabCards: (CreateCard | UpdateCard)[],
tabFiles: (CreateFile | UpdateFile)[],
options?: RequestOptions
): Promise<Tabs>
delete
Removes a Tab and all its associated nested content (Cards and Files) from the DPP.
Signature
async delete(dppId: string, tabId: string, options?: RequestOptions): Promise<void>
[!CAUTION] This action is destructive and cannot be undone. All files and data blocks nested within this tab will be permanently removed.
Errors & Troubleshooting
All methods throw an SDKError (HTTP 500) if the operation fails.