Browse topics
Places API
Read workspace places from your custom resource.
Places API
The Places API provides read-only access to places (workspaces/canvases) in a project. Use it to list all places or filter by project.
Capability required: places:read
Frontend (iframe)
import { createResourceClient } from "@rightplace/sdk";
const rp = createResourceClient();
await rp.ready();
// List places in a specific project
const places = await rp.places.list("project-id-123");
// -> [{ id: "p1", title: "Homepage", slug: "homepage", projectId: "project-id-123", ... }]
// List all places across all projects
const allPlaces = await rp.places.list();
Backend (Node.js)
import { createResourceServer } from "@rightplace/sdk/server";
const server = createResourceServer({
methods: {
getPlaces: async (_params, { rp }) => {
return await rp.places.list("project-id");
},
},
});
server.start();
API Reference
rp.places.list(projectId?)
Returns places, optionally filtered by project.
| Parameter | Type | Description |
|---|---|---|
projectId | string | Optional project filter |
| Returns | Promise<PlaceInfo[]> | List of places |
PlaceInfo
| Field | Type | Description |
|---|---|---|
id | string | Place ID |
title | string | Place title |
slug | string | URL-safe slug |
projectId | string | Owning project ID |
createdAt | number | Unix timestamp (seconds) |
updatedAt | number | Unix timestamp (seconds) |
Manifest Configuration
{
"capabilities": [
"places:read"
]
}
Notes
- This API is read-only. Resources cannot create, update, or delete places.
- The canvas data is not exposed through this API for security and performance reasons.