Browse topics
Resources API
Read resource metadata from your custom resource.
Resources API
The Resources API provides read-only access to resource metadata. Use it to discover other resources in the workspace, for cross-resource integrations or dashboards.
Capability required: resources:read
Frontend (iframe)
import { createResourceClient } from "@rightplace/sdk";
const rp = createResourceClient();
await rp.ready();
// List all resources across all projects
const all = await rp.resources.list();
// -> [{ id: "r1", name: "My API", type: "custom/api-monitor", projectId: "p1" }, ...]
// List resources in a specific project
const projectResources = await rp.resources.list("project-id-here");
Backend (Node.js)
import { createResourceServer } from "@rightplace/sdk/server";
const server = createResourceServer({
methods: {
getDashboardData: async (_params, { rp }) => {
const resources = await rp.resources.list();
return {
totalResources: resources.length,
byType: resources.reduce((acc, r) => {
acc[r.type] = (acc[r.type] || 0) + 1;
return acc;
}, {}),
};
},
},
});
server.start();
API Reference
rp.resources.list(projectId?)
| Parameter | Type | Description |
|---|---|---|
projectId | string (optional) | Filter by project ID. Omit to list all resources. |
| Returns | Promise<ResourceInfo[]> | Array of resource metadata |
ResourceInfo
| Field | Type | Description |
|---|---|---|
id | string | Resource ID |
name | string | Resource display name |
type | string | Resource type (e.g. wordpress, custom/my-type) |
projectId | string | Owning project ID |
Manifest Configuration
{
"capabilities": [
"resources:read"
]
}
Notes
- This API is read-only. Resources cannot create, update, or delete other resources.
- The
configJsonis not exposed to prevent leaking credentials or connection details between resources. - Results include both built-in and custom resource types.