Skip to content

Conversation

@rofe
Copy link
Contributor

@rofe rofe commented Oct 13, 2025

Add Optional Support for Admin API v2

Summary

This PR adds optional support for the new Admin API v2 (https://api.aem.live) while maintaining full backward compatibility with the existing Admin API v1 (https://admin.hlx.page). Sites can now opt-in to using API v2 by specifying apiVersion: 2 in their configuration.

Changes

Core Implementation

  • Added new API v2 constant in src/extension/utils/admin.js:

    • Added ADMIN_ORIGIN_V2 = 'https://api.aem.live' alongside existing ADMIN_ORIGIN
    • Updated comments for clarity: "Admin API v1" and "Admin API v2"
  • Enhanced API routing logic:

    • When apiVersion === 2 is specified, routes requests to API v2 origin
    • API v2 uses different URL patterns for login/logout/profile endpoints
    • Defaults to API v1 (current behavior) when no version is specified
  • Added default value in src/extension/app/store/site.js:

    • Set apiVersion = 1 as the default to ensure backward compatibility

Backward Compatibility

No breaking changes: All existing sites continue to use API v1 by default. API v2 is strictly opt-in via configuration.

How to Use API v2

Sites can opt-in to API v2 by adding apiVersion: 2 to their sidekick configuration:

{
  owner: 'adobe',
  repo: 'aem-boilerplate',
  apiVersion: 2  // Optional: Use API v2
}

@rofe rofe requested a review from dylandepass October 13, 2025 08:37
@rofe rofe requested a review from tripodsan October 13, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants