Skip to content

feat(mysticat-shared-seo-client): add Semrush FanoutService gRPC client#1776

Open
anagarwa wants to merge 4 commits into
mainfrom
feature/mysticat-shared-semrush-ai-client
Open

feat(mysticat-shared-seo-client): add Semrush FanoutService gRPC client#1776
anagarwa wants to merge 4 commits into
mainfrom
feature/mysticat-shared-semrush-ai-client

Conversation

@anagarwa

@anagarwa anagarwa commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds mysticat-shared-seo-client package with Semrush AI SEO gRPC client
  • Implements OAuth2 token fetch (SEO_CLIENT_ID / SEO_CLIENT_SECRET from Vault) and Bearer auth interceptor
  • Exports getGrpcClients(env) and fetchLowRankFanoutKeywords(fanoutClient, topics, domain) — fetches keywords where the brand ranks on Google but at position > 5 for each topic
  • Vendors compiled protobuf bindings for Semrush AI SEO gRPC services (ai-cr, ai-pr, ai-vo, v2/fanout, v2/topic, etc.)
  • Adds quazar-ai-seo-ts package containing the raw vendored Semrush proto TypeScript definitions

Test plan

  • Unit tests in packages/mysticat-shared-seo-client/test/grpc-client.test.js
  • fetchLowRankFanoutKeywords validated end-to-end against production FanoutService for adobe.com — returned correct low-rank keywords (e.g. "how to use generative ai", volume=480, brandPosition=6)
  • OAuth token fetch validated against Semrush production endpoint
  • spacecat-shared PR must be merged and published before spacecat-audit-worker PR can be merged

Notes

The vendor/ directories contain auto-generated protobuf JS bindings — not hand-written code. Reviewers can focus on src/grpc-client.js and src/index.js.

🤖 Generated with Claude Code

anagarwa and others added 3 commits July 1, 2026 12:27
…ages

Adds two new workspace packages:
- packages/quazar-ai-seo-ts: vendored protobuf types for Semrush AI SEO gRPC API (moved from spacecat-api-service/third-party/ai-seo-ts)
- packages/mysticat-shared-semrush-ai-client: shared gRPC client factory (getGrpcClients, getAccessToken, createAuthInterceptor) for use by audit workers and API services

Also adds quazar-ai-seo-ts to ESLint global ignores since it contains generated protobuf files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add grpc-client.js with getGrpcClients, fetchTopicHashMap and
fetchGapPrompts. Proto stubs are vendored under src/vendor/ so no
@quazar/ai-seo-ts npm dependency is needed. Export all new functions
from index.js with matching TypeScript declarations.

Remove the now-superseded mysticat-shared-semrush-ai-client package;
its functionality is fully covered here.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…owRankFanoutKeywords

Adds ai-seo.fanout scope, exposes fanoutClient via getGrpcClients, and
introduces fetchLowRankFanoutKeywords to identify SERP keywords where a
brand ranks but at position > 5.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Proto bindings are already vendored inside
packages/mysticat-shared-seo-client/src/vendor/ — no need for a
duplicate top-level package that nothing in the monorepo imports.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

This PR will trigger a minor release when merged.

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.

1 participant