You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add X-Dataverse-Skills tracking header to all execution surfaces
Inject a custom HTTP header (X-Dataverse-Skills) on every Dataverse API
call so server-side telemetry can trace requests back to the execution
surface (python-sdk, web-api, mcp-proxy) and plugin version.
- Add tracking_headers() and create_client() to auth.py
- Patch OData _headers in create_client() for automatic SDK injection
- Update mcp_proxy.py to include header on forwarded requests
- Migrate all skill SDK blocks to create_client() shorthand
- Add **tracking_headers("web-api") to all raw Web API headers dicts
- Bump plugin version to 1.2.0 across all five version locations
- Document auth.py as 5th version file in CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
from PowerPlatform.Dataverse.client import DataverseClient
88
-
89
-
load_env()
90
-
client = DataverseClient(
91
-
base_url=os.environ["DATAVERSE_URL"],
92
-
credential=get_credential(),
93
-
)
94
-
```
85
+
from auth import create_client
95
86
96
-
`get_credential()` returns `ClientSecretCredential` (if CLIENT_ID + CLIENT_SECRET are in `.env`) or `DeviceCodeCredential` (interactive fallback). See `scripts/auth.py`.
87
+
client = create_client()
88
+
```
97
89
98
-
For scripts that run to completion: wrap in `with DataverseClient(...) as client:` for automatic connection cleanup (recommended since b6). For notebooks and interactive sessions, the explicit client above is simpler.
90
+
`create_client()` loads `.env`, acquires credentials, and injects the `X-Dataverse-Skills` tracking header on every SDK HTTP call. It returns a `DataverseClient` ready to use. See `scripts/auth.py`.
- Creating publishers or solutions? → `client.records.create("publisher", {...})`, `client.records.create("solution", {...})` — see `dv-solution`
75
75
76
-
**Before using `from auth import get_token` or `import requests`:** check whether the operation is in the Raw Web API list below. If it is not in that list — the SDK supports it — use `from auth import get_credential` + `DataverseClient` instead. Using raw HTTP for SDK-supported operations is the most common off-rails mistake.
76
+
**Before using `from auth import get_token` or `import requests`:** check whether the operation is in the Raw Web API list below. If it is not in that list — the SDK supports it — use `from auth import create_client` instead. Using raw HTTP for SDK-supported operations is the most common off-rails mistake.
77
77
78
78
**Raw Web API (`get_token()`) is ONLY acceptable for:** forms, views, global option sets, N:N`$ref` associations, N:N`$expand`, `$apply` aggregation, memo columns, and unbound actions. Everything else MUST use MCP (if available) or the SDK.
from PowerPlatform.Dataverse.client import DataverseClient
79
+
from auth import create_client
81
80
82
-
load_env()
83
-
client = DataverseClient(
84
-
base_url=os.environ["DATAVERSE_URL"],
85
-
credential=get_credential(),
86
-
)
81
+
client = create_client()
87
82
```
88
83
89
-
For scripts that run to completion: wrap in `with DataverseClient(...) as client:` for automatic connection cleanup (recommended since b6). For notebooks and interactive sessions, the explicit client above is simpler.
84
+
`create_client()` loads `.env`, acquires credentials, and injects the `X-Dataverse-Skills` tracking header on every SDK HTTP call. See `scripts/auth.py`.
90
85
91
86
---
92
87
@@ -193,7 +188,7 @@ for page in client.records.get(
0 commit comments