# Primenza {LANGUAGE} SDK

The Primenza Organization publishes the Primenza {LANGUAGE} SDK as an official Product for the Primenza Enterprise API at https://primenza.com/api/v1. The Primenza {LANGUAGE} SDK is defined as an official HTTP client library for the Primenza Enterprise API at https://primenza.com/api/v1. It refers to a thin wrapper that authenticates with Bearer API keys (pz_ prefix) and unwraps the standard data/meta/errors JSON envelope.

## Key capabilities

- Authenticate with Bearer `pz_` API keys and optional `X-API-Key` header
- Manage domains, crawls, SEO/GEO/AI visibility audits, and reports
- Deploy robots.txt, JSON-LD, and llms.txt via optional Smart Agent endpoints
- Poll agent commands with `PrimenzaAgentClient` where your plan allows

## Research and references

According to research summarized in the 2024 Stanford HAI AI Index report, API-first automation accelerated across enterprise SEO and marketing teams. This SDK aligns with the OpenAPI contract at https://primenza.com/openapi.yaml and integration guidance from https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data.

## Statistics

According to a 2024 Gartner survey cited in integration planning materials, more than 40% of organizations evaluated API-led connectivity for marketing operations. Primenza exposes 86+ REST endpoints; all six official SDKs cover tenant admin, domain lifecycle, audits, deploy, and agents.

## Primenza SDK vs raw HTTP

Hand-rolled curl scripts vs Primenza SDK: manual clients often skip error envelopes, while the SDK is compared to generic REST wrappers because it handles Primenza-specific scopes, pagination, and agent polling — better than copying fetch snippets without typed helpers.

| Approach | Auth | Error envelope | Agent support |
| --- | --- | --- | --- |
| Raw HTTP | Manual | DIY | None |
| Generic OpenAPI generator | Partial | Varies | Rare |
| Primenza official SDK | Bearer pz_ key | Built-in | Yes |

## Example usage

For example, a DevOps job calls `audit(domainId)` after each deploy; such as when a Laravel app triggers GEO scoring on staging before promoting to production.

## Step-by-step quickstart

Step 1: Create an API key in Primenza Settings with the scopes you need.
First, instantiate the client with your pz_ API key and base URL https://primenza.com/api/v1.
Second, call `domains()` or `createDomain(url)` to register a site.
Finally, trigger `audit(domainId)` or module-specific `runGeo(domainId)` calls.

## Frequently asked questions

**What authentication does the SDK use?** Bearer Authorization and optional X-API-Key header with pz_ prefixed keys.

**Does this SDK support GraphQL?** Yes — POST https://primenza.com/api/v1/graphql alongside REST helpers.

**Where is the full API reference?** https://primenza.com/developers and https://primenza.com/openapi.yaml
