# Code Deb Search Console SDK

**Target release:** `@codedeb/search-console@0.1.0` passed isolated ESM installation and TypeScript checks. Its public npm publication has not been independently verified; check the registry before installation.

Google Search Console performance and inspection API — intended for developers building reliable storefronts, search infrastructure and production applications. Unlike a hosted platform, the SDK does not require a Code Deb account for its pure functions.

## Build, test and stage

```bash
npm ci
npm run test:nepal-sdks
npm run sdk:pack:verify
node scripts/sdk/stage-npm-package.mjs sdk-search-console
```

These commands prepare the candidate without publishing it. Review the generated `.sdk-artifacts/npm-stage/sdk-search-console` contents and all licenses. After a successful, independently verified npm release, the installation command will be `npm install @codedeb/search-console`. Do not advertise this command as publicly working before release verification.

## Quickstart using implemented exports

```ts
import {createSearchConsoleClient} from '@codedeb/search-console';
const client=createSearchConsoleClient({getAccessToken:async()=>process.env.GSC_TOKEN!});
const data=await client.searchAnalytics({siteUrl:'sc-domain:example.com',startDate:'2026-11-01',endDate:'2026-11-15',dimensions:['page','query']});
console.log(data.rows?.length);
```

## Public API contract

| Entry point or function | Responsibility |
| --- | --- |
| `createSearchConsoleClient({getAccessToken})` | Authorized REST queries without persisting credentials |
| `client.searchAnalytics(request)` | Bounded Search Analytics dimensions, date range, row limit and offset |
| `client.inspectUrl(siteUrl,url)` | Inspect Google index status for a verified URL property |
| `client.listSitemaps(siteUrl)` | Read registered sitemaps from Search Console |
| `searchOpportunityRows(rows)` | Find high-impression, low-CTR queries for editorial review |

## Production integration

Requires consented OAuth credentials, property ownership or access and quota monitoring. Search Analytics can return top rows rather than every result. URL Inspection reports Google-index observations, not live-page validation or guaranteed indexation.

The published SDK must have bounded resource use, correct authentication boundaries where applicable, and tests for malformed input. Caller-owned storage, OAuth, background jobs or hosted services must be configured explicitly rather than invented by the library.

## Compatibility and release history

- **0.1.0 candidate — 21 November 2026:** First implementation of the documented independent module, subject to the complete release gate.
- JavaScript ESM with generated TypeScript declarations; Node.js 20+ for Node execution.
- No npm publication, hosted API, SLA, vendor certification, ranking guarantee or customer data access is implied by this candidate.
- Code Deb-owned package code is intended for Apache-2.0 distribution. Third-party dependencies, data and trademarks retain their own terms.

## References and related SDKs

- [Developer SDK index](/docs/sdk)
- [Code Deb Developer resources](/docs/resources)
- [Reference standards and vendor documentation](https://developers.google.com/webmaster-tools/v1/searchanalytics/query)




## Integration design walkthrough

1. Use a property-scoped OAuth token from a verified Google Search Console owner.
2. Keep credentials server-side and respect API query limits.
3. Interpret missing long-tail rows and quota restrictions without inventing totals.
4. Use URL Inspection evidence to guide review; an inspection is not a ranking guarantee.

## Release verification and package installation

```bash
npm view @codedeb/search-console@0.1.0 version
# Only after the registry returns this exact version:
npm install @codedeb/search-console@0.1.0
```

Never confuse a passing local package/TypeScript test with accepted npm publication. The npm registry must expose version metadata, the expected `latest` dist-tag and a retrievable tarball before the release is announced as installable. The source repository and customer integrations remain private.

## Production acceptance checklist

- Exercise normal, empty and malformed input using the documented ESM exports.
- Compare results with source HTML or authorized external API evidence, not generated placeholder data.
- Implement explicit failure handling, timeouts and limits in any caller-owned network adapter.
- Record meaningful audit findings and version-specific regressions without claiming search rankings or Google approval.

## Common problems

**Version not found:** Confirm the package's exact version on [npm](https://www.npmjs.com/package/@codedeb/search-console); its release may still be pending. **Unexpected findings:** Compare real captured HTML and HTTP status with your audit inputs. **Third-party integration fails:** Verify your own OAuth, hosting, robots compliance and network policies; the SDK never grants external access.

## Related guides

[seo](/docs/sdk/seo) · [seo monitor](/docs/sdk/seo-monitor) · [All developer SDKs](/docs/sdk) · [Engineering resources](/docs/resources)
