migrate from Ahrefs/SpaceCat API key to Semrush/IMS session token auth - #22
Draft
habansal wants to merge 3 commits into
Draft
migrate from Ahrefs/SpaceCat API key to Semrush/IMS session token auth#22habansal wants to merge 3 commits into
habansal wants to merge 3 commits into
Conversation
- Replace dead spacecat-sdk package with @adobe/mysticat-shared-seo-client
- Replace AhrefsAPIClient with SeoClient (Semrush) across all assessments
- Replace SPACECAT_API_KEY (x-api-key header) with SPACECAT_SESSION_TOKEN
(Authorization: Bearer) across all SpaceCat API calls
- Replace SpaceCatSdk.getSite() with direct REST fetch to /sites/by-base-url
- Update PageProvider to use seoClient.getTopPages(url, { limit }) signature
- Update brokenBacklinks to use SeoClient.getBrokenBacklinks two-step approach
- Update README setup instructions with new required env vars
- Update tests to reflect new SeoClient interface
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
habansal
marked this pull request as draft
August 19, 2026 08:41
- Make SpaceCat lookup optional: warn and continue if site not found or token not set, rather than throwing - Strip www. prefix before SpaceCat base-URL lookup to match stored format - Fix sitemap index parsing passing object instead of URL string to fetch Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spacecat-sdkpackage with@adobe/mysticat-shared-seo-client(Semrush); removespacecat-audit-workerimports that were never inpackage.jsonAhrefsAPIClientwithSeoClientacross all assessments (brokenBacklinks,brokenInternalLinks,canonical,PageProvider) — uses Semrushbacklinks_pages+backlinkstwo-step approach matching audit-worker v1SPACECAT_API_KEY(x-api-keyheader) withSPACECAT_SESSION_TOKEN(Authorization: Bearer) across all SpaceCat API calls; replaceSpaceCatSdk.getSite()with direct REST fetch toGET /sites/by-base-url/:base64urlNew
.envrequiredTest plan
npm installcompletes without errorsnpm run broken-backlinks <baseURL>returns Semrush-sourced results withsource: semrushnpm run canonical <baseURL>fetches top pages from Semrush (log: "Fetching top N pages from Semrush")npm run broken-internal-links <baseURL>fetches pages via Semrushall-broken-backlinks-enabled.js,all-gsc-enabled.js,all-jsonld-enabled.js,enable-404.jsauthenticate via Bearer token without 401🤖 Generated with Claude Code