Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix phantom @spree/dashboard-sdk / Admin* type names in docs

Damian Legawieced7c76155629
diff --git a/docs/developer/dashboard/concepts.mdx b/docs/developer/dashboard/concepts.mdx
index 057feb4ef7..0da9c1c0c6 100644
--- a/docs/developer/dashboard/concepts.mdx
+++ b/docs/developer/dashboard/concepts.mdx
@@ -18,7 +18,7 @@ This page is a five-minute orientation for the dashboard's technology choices an
| Styling | [Tailwind v4](https://tailwindcss.com/) + [shadcn/ui](https://ui.shadcn.com/) + [Base UI](https://base-ui.com/) | Utility classes + headless primitives |
| i18n | [i18next](https://www.i18next.com/) | Translations, fallback chains |
| Lint/format | [Biome](https://biomejs.dev/) | ESLint + Prettier in one tool |
-| HTTP | [`@spree/dashboard-sdk`](https://www.npmjs.com/package/@spree/dashboard-sdk) | Typed Admin API client |
+| HTTP | [`@spree/admin-sdk`](https://www.npmjs.com/package/@spree/admin-sdk) | Typed Admin API client |
The dashboard is a **Single Page Application**: one HTML page, all routing client-side. No Rails views, no Turbo, no server-rendered partials. Everything the user sees comes from React components fetching JSON from `/api/v3/admin/*`.
diff --git a/docs/developer/dashboard/customization/backend.mdx b/docs/developer/dashboard/customization/backend.mdx
index c10b551a9b..97e0e38451 100644
--- a/docs/developer/dashboard/customization/backend.mdx
+++ b/docs/developer/dashboard/customization/backend.mdx
@@ -4,7 +4,7 @@ sidebarTitle: Backend integration
description: Talk to your own (or Spree's) Admin API from the dashboard — typed SDK calls, custom endpoints, prefixed IDs, error handling, and React-Query hooks.
---
-The dashboard never reaches into Rails models or fetches HTML. All data flows through `@spree/dashboard-sdk` — a typed Admin API client. This page covers the patterns: calling existing endpoints, adding new ones, handling errors, and wrapping it all in React-Query hooks for caching.
+The dashboard never reaches into Rails models or fetches HTML. All data flows through `@spree/admin-sdk` — a typed Admin API client. This page covers the patterns: calling existing endpoints, adding new ones, handling errors, and wrapping it all in React-Query hooks for caching.
## The `adminClient`
@@ -85,7 +85,7 @@ The `invalidateQueries` array refetches dependent queries on success.
The SDK throws `SpreeError` for non-2xx responses. The error carries `status`, `code`, and `details` — the last contains the Rails error hash for 422s.
```ts
-import { SpreeError } from '@spree/dashboard-sdk'
+import { SpreeError } from '@spree/admin-sdk'
try {
await adminClient.products.update(id, payload)
diff --git a/docs/developer/dashboard/customization/tables.mdx b/docs/developer/dashboard/customization/tables.mdx
index 49e5f788ba..0b3754a4e7 100644
--- a/docs/developer/dashboard/customization/tables.mdx
+++ b/docs/developer/dashboard/customization/tables.mdx
@@ -25,7 +25,7 @@ Each entry has a `key` so it can be referenced later for `update` or `remove`. L
```tsx
import { tables } from '@spree/dashboard-core'
-import type { AdminProduct } from '@spree/dashboard-sdk'
+import type { Product } from '@spree/admin-sdk'
tables.products.columns.add({
key: 'brand',
@@ -35,7 +35,7 @@ tables.products.columns.add({
})
```
-`cell` is a TanStack-Table `ColumnDef` cell renderer — `row` is fully typed as the resource (`AdminProduct`, `AdminOrder`, …) when you reach it from a typed registry key.
+`cell` is a TanStack-Table `ColumnDef` cell renderer — `row` is fully typed as the resource (`Product`, `Order`, …) when you reach it from a typed registry key.
### Sort + filter on a column
diff --git a/docs/developer/dashboard/plugins/publishing.mdx b/docs/developer/dashboard/plugins/publishing.mdx
index 35c071b5ea..b9bdec330d 100644
--- a/docs/developer/dashboard/plugins/publishing.mdx
+++ b/docs/developer/dashboard/plugins/publishing.mdx
@@ -17,7 +17,7 @@ Your plugin imports React, the dashboard, Tailwind, i18next, etc., but **you don
"react-dom": "^18.0.0 || ^19.0.0",
"@spree/dashboard-core": ">=6.0.0-0",
"@spree/dashboard-ui": ">=6.0.0-0",
- "@spree/dashboard-sdk": ">=6.0.0-0",
+ "@spree/admin-sdk": ">=6.0.0-0",
"i18next": "^25.0.0",
"react-i18next": "^16.0.0",
"@tanstack/react-query": "^5.0.0",
diff --git a/docs/developer/dashboard/public-api.mdx b/docs/developer/dashboard/public-api.mdx
index d806b7db34..d1ab38eb43 100644
--- a/docs/developer/dashboard/public-api.mdx
+++ b/docs/developer/dashboard/public-api.mdx
@@ -115,7 +115,7 @@ import {
import { adminClient } from '@spree/dashboard-core'
```
-The shared `@spree/dashboard-sdk` instance configured for the host's API URL. Use this everywhere instead of constructing your own.
+The shared `@spree/admin-sdk` instance configured for the host's API URL. Use this everywhere instead of constructing your own.
### Providers
@@ -186,30 +186,35 @@ import { cn } from '@spree/dashboard-ui' // clsx + tailwind-merge
## `@spree/dashboard`
-The deployable app. **You normally don't import from here in a plugin.** The exception is when you're composing a custom dashboard variant (e.g., a vendor portal) and want to reuse a resource hook:
+The app shell. **Plugins don't import from here** — a plugin extends the dashboard through `@spree/dashboard-core` and never renders the shell. The host (the `dashboard-starter` project, or a create-spree-app project) is what imports it, to mount the admin:
```ts
-import {
- useOrders,
- useProducts,
- useCustomers,
- // …per-resource hooks
-} from '@spree/dashboard'
+import { createDashboardRouter, Dashboard } from '@spree/dashboard'
+```
+
+- **`Dashboard`** — the app shell component (provider stack + router). Render it with a router: `<Dashboard router={router} />`.
+- **`createDashboardRouter(routeTree)`** — builds the router from the host's generated `routeTree.gen.ts` (the shell's routes composed with every installed plugin's file routes). The starter's `main.tsx` wires these together; you rarely write this by hand.
+
+Two subpath entries complete the surface:
+
+```ts
+import { spreeDashboardPlugin } from '@spree/dashboard/vite' // Vite plugin: Tailwind, discovery, route composition
+import '@spree/dashboard/styles.css' // the app's CSS entry
```
-Importing from `@spree/dashboard` pins your code to the deployable app's version. If you only need the underlying primitives, prefer `@spree/dashboard-core`.
+Importing from `@spree/dashboard` pins your code to the deployable app's version. Plugins and custom UI should prefer `@spree/dashboard-core` + `@spree/dashboard-ui`.
-## What about `@spree/dashboard-sdk`?
+## What about `@spree/admin-sdk`?
-The SDK is a separate package and a public dependency. Import types and `SpreeError` from it directly:
+The Admin API client is a separate package and a public dependency. Import types and `SpreeError` from it directly:
```ts
import {
- type AdminProduct,
- type AdminOrder,
- type AdminCustomer,
+ type Product,
+ type Order,
+ type Customer,
SpreeError,
-} from '@spree/dashboard-sdk'
+} from '@spree/admin-sdk'
```
The `adminClient` instance, by contrast, comes from `@spree/dashboard-core` so the host owns the configured singleton.
@@ -224,4 +229,4 @@ Anything not listed here is internal. If you find yourself wanting it, open a di
- [`packages/dashboard-core/src/index.ts`](https://github.com/spree/spree/blob/main/packages/dashboard-core/src/index.ts) — canonical export list
- [`packages/dashboard-ui/src/index.ts`](https://github.com/spree/spree/blob/main/packages/dashboard-ui/src/index.ts)
-- [`packages/dashboard-sdk/src/index.ts`](https://github.com/spree/spree/blob/main/packages/dashboard-sdk/src/index.ts)
+- [`packages/admin-sdk/src/index.ts`](https://github.com/spree/spree/blob/main/packages/admin-sdk/src/index.ts)
diff --git a/docs/developer/dashboard/recipes/page-action-button.mdx b/docs/developer/dashboard/recipes/page-action-button.mdx
index c3dc5f2f91..d5f075f2fc 100644
--- a/docs/developer/dashboard/recipes/page-action-button.mdx
+++ b/docs/developer/dashboard/recipes/page-action-button.mdx
@@ -23,7 +23,7 @@ import { useResourceMutation } from '@spree/dashboard-core'
import { adminClient } from '@spree/dashboard-core'
interface Props {
- resource: { id: string; state: string } // AdminOrder
+ resource: { id: string; state: string } // Order
}
export function SendInvoiceButton({ resource }: Props) {
@@ -179,7 +179,7 @@ export function ResetCartItem({ resource }: { resource: { id: string } }) {
## Context
-The `resource` prop is whatever the host page passed to `<PageHeader resource={…} />`. On the order detail page it's an `AdminOrder`; on a product page it's an `AdminProduct`. The slot doesn't statically know which — see [Slots](/developer/dashboard/customization/slots) for the typing escape hatches.
+The `resource` prop is whatever the host page passed to `<PageHeader resource={…} />`. On the order detail page it's an `Order`; on a product page it's an `Product`. The slot doesn't statically know which — see [Slots](/developer/dashboard/customization/slots) for the typing escape hatches.
If you need the current store/user/permissions, they're also merged into the props bag:
diff --git a/docs/developer/dashboard/recipes/sidebar-widget.mdx b/docs/developer/dashboard/recipes/sidebar-widget.mdx
index ef81080264..178db25368 100644
--- a/docs/developer/dashboard/recipes/sidebar-widget.mdx
+++ b/docs/developer/dashboard/recipes/sidebar-widget.mdx
@@ -112,7 +112,7 @@ The permission gate lives *inside* the component (`usePermissions`) rather than
The pattern above fetches its own data. The alternative is to read it from the resource the host passes:
```tsx
-function MyCard({ customer }: { customer: AdminCustomer }) {
+function MyCard({ customer }: { customer: Customer }) {
return <div>{customer.loyalty_points}</div> // host already loaded it
}
```
diff --git a/docs/developer/sdk/admin/quickstart.mdx b/docs/developer/sdk/admin/quickstart.mdx
index 56f8979203..fec02bf8a6 100644
--- a/docs/developer/sdk/admin/quickstart.mdx
+++ b/docs/developer/sdk/admin/quickstart.mdx
@@ -52,9 +52,9 @@ const product = await client.products.create({
Every method is fully typed — responses use `Admin`-prefixed types generated from the API serializers:
```typescript
-import type { AdminOrder, PaginatedResponse } from '@spree/admin-sdk'
+import type { Order, PaginatedResponse } from '@spree/admin-sdk'
-const page: PaginatedResponse<AdminOrder> = await client.orders.list()
+const page: PaginatedResponse<Order> = await client.orders.list()
```
<Note>