Releases: Sitecore/marketplace-sdk
@sitecore-marketplace-sdk/core@0.2.2
Patch Changes
- a650e09: Add OrganizationID and MarketplaceTenantID in ApplicationRuntimeContext
@sitecore-marketplace-sdk/xmc@0.2.1
Patch Changes
-
fec9f87: # experimental_XMC
🚀 What's New
Server-side API Support
experimental_XMC enables API access to Sitecore APIs without requiring the Client SDK mode. Perfect for server-side applications that need to communicate with Sitecore APIs.
Setup
import { experimental_createXMCClient } from '@sitecore-marketplace-sdk/xmc'; // No Host SDK required const xmc = await experimental_createXMCClient({ getAccessToken: () => auth0.getAccessTokenSilently(), });
Enhanced Type Safety
import { experimental_Sites } from '@sitecore-marketplace-sdk/xmc'; // Optional: Full IntelliSense support with types const response = await xmc.sites.listLanguages(); let data: experimental_Sites.ListLanguagesResponse = response.data!;
🎯 Quick Start
1. Install and Import
import { experimental_createXMCClient } from '@sitecore-marketplace-sdk/xmc'; // Optional: import types for enhanced IntelliSense import { experimental_Sites } from '@sitecore-marketplace-sdk/xmc';
2. Initialize with Auth
const xmc = await experimental_createXMCClient({ getAccessToken: () => auth0.getAccessTokenSilently(), });
3. Use APIs
// Sites API const languages = await xmc.sites.listLanguages({ query: { sitecoreContextId: 'your-context-id' }, }); // Pages API const pages = await xmc.pages.search({ query: { sitecoreContextId: 'your-context-id' }, }); // Authoring API const result = await xmc.authoring.graphql({ body: { query: `query { sites { name } }`, }, query: { sitecoreContextId: 'your-context-id' }, }); // Content Transfer API const transfer = await xmc.contentTransfer.createContentTransfer({ body: { configuration: { dataTrees: [ { itemPath: '/sitecore/content/Home', scope: 'SingleItem', mergeStrategy: 'OverrideExistingItem', }, ], }, transferId: crypto.randomUUID(), }, query: { sitecoreContextId: 'your-context-id' }, }); // Preview API const previewContent = await xmc.preview.graphql({ body: { query: `query { item(path: "/sitecore/content/Home", language: "en") { id name path fields { name value } } }`, }, query: { sitecoreContextId: 'your-context-id' }, }); // Live API const liveContent = await xmc.live.graphql({ body: { query: `query { item(path: "/sitecore/content/Home", language: "en") { id name path fields { name value } } }`, }, query: { sitecoreContextId: 'your-context-id' }, });
🔧 Use Cases
Server-Side Applications
// Node.js server, Azure Functions, AWS Lambda, etc. const xmc = await experimental_createXMCClient({ getAccessToken: () => getServerSideToken(), }); // Direct API calls without browser context const languages = await xmc.sites.listLanguages();
🎨 Optional Type Support
For enhanced IntelliSense, you can optionally import type namespaces:
experimental_Sites.*
- Sites API typesexperimental_Pages.*
- Pages API typesexperimental_Authoring.*
- Authoring API typesexperimental_ContentTransfer.*
- Content Transfer API typesexperimental_Content.*
- Content API types
@sitecore-marketplace-sdk/xmc@0.2.0
Minor Changes
-
ff3ca07: Update XMC SDK to support new extensionPoint naming conventions
Compatibility Update:
- Updated to work with new extensionPoint interfaces from core SDK
- Maintains full backward compatibility with existing touchpoint-based code
- No breaking changes to XMC-specific functionality
What changed:
- Updated dependencies to support new extensionPoint types
- Enhanced type compatibility for both old and new naming conventions
- Maintained all XMC-specific functionality while supporting new interface names
Patch Changes
- Updated dependencies [ff3ca07]
- @sitecore-marketplace-sdk/client@0.2.0
@sitecore-marketplace-sdk/client@0.2.0
Minor Changes
-
ff3ca07: Updated application context response with improved property naming and enhanced type definitions
🔄 What's Changed in Application Context Response:
When you call
client.query('application.context')
, the response now includes updated property names for better clarity:New Property Names (Recommended):
const context = await client.query('application.context'); // ✅ New: resourceAccess (replaces resources) context.data.resourceAccess; // Array of resource access information // ✅ New: extensionPoints (replaces touchpoints) context.data.extensionPoints; // Array of available extension points
Legacy Properties (Still Supported):
// ⚠️ Deprecated but still works: resources context.data.resources; // Still returns resource data // ⚠️ Deprecated but still works: touchpoints context.data.touchpoints; // Still returns extension point data
📋 Updated Response Structure:
// Application context now returns both old and new properties interface ApplicationContext { // Resource access information resourceAccess: ApplicationResourceContext[]; // ✅ New name resources: ApplicationResourceContext[]; // ⚠️ Deprecated // Extension points information extensionPoints: ApplicationExtensionPointContext[]; // ✅ New name touchpoints: ApplicationTouchpointContext[]; // ⚠️ Deprecated // Other properties remain unchanged id: string; name: string; url: string; // ... etc }
✅ Full Backward Compatibility:
Your existing code continues to work without any changes:
- ✅ All existing property access (
resources
,touchpoints
) functions normally - ✅ No breaking changes to response structure
- ✅ Both old and new properties are available in every response
- ✅ Update at your own pace - no migration pressure
🚀 Benefits of New Names:
resourceAccess
: More accurately describes granted access permissionsextensionPoints
: Better describes integration points in your application- Consistency: Aligns with modern naming conventions across Sitecore products
- Clarity: More descriptive names improve code readability
📖 Migration Examples:
// Before (still works) const resources = context.data.resources; const touchpoints = context.data.touchpoints; resources.forEach((resource) => { console.log(`Access to: ${resource.resourceId}`); }); touchpoints.forEach((touchpoint) => { console.log(`Extension point: ${touchpoint.touchpointId}`); }); // After (recommended for new code) const resourceAccess = context.data.resourceAccess; const extensionPoints = context.data.extensionPoints; resourceAccess.forEach((access) => { console.log(`Access to: ${access.resourceId}`); }); extensionPoints.forEach((point) => { console.log(`Extension point: ${point.extensionPointId}`); });
🔧 Recommended Migration Path:
- Immediate: No action required - existing code continues working
- New Code: Use
resourceAccess
andextensionPoints
for new implementations - Gradual Updates: Update existing code when convenient during regular maintenance
- IDE Benefits: New property names provide better IntelliSense and type checking
This update improves the clarity of your application context data while maintaining complete backward compatibility.
- ✅ All existing property access (
@sitecore-marketplace-sdk/core@0.2.1
Patch Changes
- d41657b: Fixes
AllowedExtensionPoints
exports
@sitecore-marketplace-sdk/core@0.2.0
Minor Changes
-
ff3ca07: Introduce new extensionPoint naming conventions with full backward compatibility
New Features:
- Added
AllowedExtensionPoints
type alias forAllowedTouchpoints
enum - Added
ApplicationExtensionPointContext
interface as the new standard (replacesApplicationTouchpointContext
) - Added
ApplicationExtensionPointMetaContext
interface as the new standard (replacesApplicationTouchpointMetaContext
) - Added
extensionPoints
property toApplicationContext
andApplicationRuntimeContext
interfaces - Updated
resourceAccess
property naming (replaces deprecatedresources
)
Backward Compatibility:
This is a fully backward-compatible change. All existing code will continue to work without modifications:
AllowedTouchpoints
enum remains unchanged and fully functionalApplicationTouchpointContext
andApplicationTouchpointMetaContext
interfaces remain functional but are marked as deprecatedtouchpoints
andresources
properties continue to work but show deprecation warnings
What changed:
- Added new
extensionPoints
property alongside deprecatedtouchpoints
- Added new extension point interfaces with cleaner naming
- Added type alias for better API consistency
- Maintained full backward compatibility with automatic property mapping
- Added
@sitecore-marketplace-sdk/xmc@0.1.7
Patch Changes
- 90aaa94: XMC package now includes exported types for query and mutation requests and responses.
@sitecore-marketplace-sdk/core@0.1.6
@sitecore-marketplace-sdk/xmc@0.1.4
@sitecore-marketplace-sdk/core@0.1.5
Patch Changes
- 402b92a: Adds types for host init new property
applicationContext