Weevir SDK
Signal-based governance and telemetry connectors (wevr-sdk / @wevr/sdk-js / Wevr.Sdk).
The Weevir platform repo stays private. These packages are published to public registries so anyone with a license key can install and start sending traffic.
Install
# Python 3.9+ — core: Weevir Postgres sink, Postgres/PGVector, REST
pip install wevr-sdk
pip install "wevr-sdk[llm]" # OpenRouter only (do not install if unused)
pip install "wevr-sdk[mongo]" # MongoDB only (do not install if unused)
# JavaScript (Node 18+) — REST + OpenRouter use fetch (no extra LLM package)
npm install @wevr/sdk-js
npm install pg # only if using WevrPostgresSink
# .NET 8+ — REST + OpenRouter + WevrPostgresSink (Npgsql only)
dotnet add package Wevr.Sdk
Pin a version in production (wevr-sdk==0.5.1, @wevr/sdk-js@0.5.1, Wevr.Sdk 0.5.1).
Startup docs (Python + npm)
Each public package ships developer and coding-agent briefs. Print them after install:
# Python
wevr-advise start # developers
wevr-advise agents # coding agents
# JavaScript
npx wevr-advise start
npx wevr-advise agents
| Audience | Python (wevr-sdk) |
npm (@wevr/sdk-js) |
|---|---|---|
| Developers | wevr/docs/GETTING_STARTED.md |
docs/GETTING_STARTED.md |
| Coding agents | wevr/docs/AGENTS.md |
docs/AGENTS.md |
Requirements
- A Weevir license key (
wk_…) for your organization — see Get your license key - Weevir governance Postgres (
WEVR_PG_*) - Environment name + type on every process (no dashboard registration step)
Quick verify
import wevr
print(wevr.__version__)
import { EnvironmentType } from '@wevr/sdk-js';
console.log(EnvironmentType.PROD);
using Wevr.Sdk;
Console.WriteLine(WevrEnvironmentResolver.DeploymentKey("billing-api", EnvironmentType.PROD));
Connectors
| Connector | Sample | Import | Role |
|---|---|---|---|
| Weevir Postgres | CONNECTOR_WEVR_POSTGRES.md | Python: WevrPostgresConnectorJS/.NET: WevrPostgresSink |
Governance sink (envelopes + safeguard cache). Required by REST / OpenRouter / Mongo. |
| PostgreSQL | CONNECTOR_POSTGRES.md | wevr.connect.storage.postgres.PostgresConnector |
Governed target Postgres (execute) — Python |
| PGVector | CONNECTOR_PGVECTOR.md | wevr.connect.storage.vector.VectorPostgresConnector |
Postgres + pgvector inserts — Python |
| MongoDB | CONNECTOR_MONGODB.md | wevr.connect.storage.mongo.MongoDBConnector |
Governed MongoDB — Python (wevr-sdk[mongo]) |
| REST API | CONNECTOR_REST.md | Python / JS / .NET RestApiConnector |
Governed HTTP client |
| OpenRouter (LLM) | CONNECTOR_OPENROUTER.md | Python / JS / .NET OpenRouter |
Governed LLM gateway |
All consumer connectors emit telemetry through Weevir Postgres (WEVR_PG_*) and need your license key as tenant_id.
Initialise Weevir (required)
| Field | Env var | Example |
|---|---|---|
| License key | WEVR_LICENSE_KEY |
wk_… |
| Environment name | WEVR_ENVIRONMENT_NAME |
billing-api |
| Environment type | WEVR_ENVIRONMENT_TYPE |
PROD | QA | DEV | UAT |
Missing name or type → connector init fails (no silent default).
import os
from wevr.connect.storage.postgres import WevrPostgresConnector
from wevr.connect.http.rest import RestApiConnector
wevr_pg = WevrPostgresConnector(tenant_id=os.getenv("WEVR_LICENSE_KEY"))
wevr_pg.connect()
rest = RestApiConnector(
tenant_id=os.getenv("WEVR_LICENSE_KEY"),
wevr_pg=wevr_pg,
environment_name=os.getenv("WEVR_ENVIRONMENT_NAME"),
environment_type=os.getenv("WEVR_ENVIRONMENT_TYPE"),
)
rest.connect()
import { RestApiConnector, WevrPostgresSink } from '@wevr/sdk-js';
const wevrPg = new WevrPostgresSink({ tenantId: process.env.WEVR_LICENSE_KEY });
const rest = new RestApiConnector({
tenantId: process.env.WEVR_LICENSE_KEY,
wevrPg,
environment: {
name: process.env.WEVR_ENVIRONMENT_NAME,
type: process.env.WEVR_ENVIRONMENT_TYPE,
},
});
await rest.connect();
using Wevr.Sdk;
await using var wevrPg = new WevrPostgresSink(new WevrPostgresSinkOptions
{
TenantId = Environment.GetEnvironmentVariable("WEVR_LICENSE_KEY"),
});
await using var rest = new RestApiConnector(new RestApiConnectorOptions
{
TenantId = Environment.GetEnvironmentVariable("WEVR_LICENSE_KEY"),
WeevirPg = wevrPg,
EnvironmentName = Environment.GetEnvironmentVariable("WEVR_ENVIRONMENT_NAME"),
EnvironmentType = Environment.GetEnvironmentVariable("WEVR_ENVIRONMENT_TYPE"),
});
await rest.ConnectAsync();
How environments appear
- Install the package on a host / container / region
- Set the same org
WEVR_LICENSE_KEY - Set a unique pair: name + type for that install
- Run traffic — envelopes land under
org_idwith deployment key{name}/{type} - Refresh the dashboard — the environment appears under filters, Environments, Settings, and live metrics
| Concept | Rule |
|---|---|
| Deployment key | {name}/{type} lowercase, e.g. billing-api/prod |
| Isolation | Same name + different type = different environments |
| Org scope | Same license → one org; unlimited distinct name/type pairs (subject to plan) |
Runtime environment variables
| Variable | Purpose |
|---|---|
WEVR_LICENSE_KEY |
Org license (wk_…) — required |
WEVR_ENVIRONMENT_NAME |
Deployment name (text) — required |
WEVR_ENVIRONMENT_TYPE |
PROD / QA / DEV / UAT — required |
WEVR_PG_HOST / PORT / USER / PASSWORD / DB |
Weevir governance Postgres |
OPENROUTER_API_KEY |
OpenRouter LLM connector |
PG_HOST / PORT / USER / PASSWORD / DB |
Target app Postgres (Python PostgresConnector) |
MONGO_URI or MONGO_HOST / PORT / USER / PASSWORD / DB / COLLECTION |
Target MongoDB (Python) |
WEVR_REST_BEARER_TOKEN / WEVR_REST_API_KEY |
Optional auth for RestApiConnector |
Get your license key
- Log in to the Weevir dashboard
- Open Settings — the license key is shown on the org card as
WEVR_LICENSE/license_key - Store it as
WEVR_LICENSE_KEY(env var / secrets manager). Do not putwk_…in dashboardtenantIdquery params — the API expects the resolvedorg_idUUID there.
Signup also returns org.license_key. One license key = one organization.
Package layout
| Path | Purpose |
|---|---|
src/wevr/ |
Python SDK (pip install wevr-sdk) |
js/ |
JavaScript SDK (npm install @wevr/sdk-js) |
dotnet/Wevr.Sdk/ |
.NET SDK (dotnet add package Wevr.Sdk) |
tests/ |
Python pytest suite |
js/test/ |
Node test suite |
dotnet/Wevr.Sdk.Tests/ |
xUnit suite |
Local development (contributors)
From this folder (Weevir.SDK):
pip install -e ".[llm,mongo,test]"
cd js && npm test
dotnet test dotnet/Wevr.Sdk.Tests/Wevr.Sdk.Tests.csproj
Maintainers: publish
Platform source stays in the private GitHub repo. CI publishes only these three packages when you push a tag sdk-vX.Y.Z (for example sdk-v0.5.1).
One-time registry setup
- PyPI — create the project
wevr-sdk(or confirm the name is free). Add GitHub secretPYPI_API_TOKEN(Trusted Publishing is preferred). - npm — create the
@wevrorg (or change the package name injs/package.json). Add GitHub secretNPM_TOKENwith publish rights. Scoped packages need"publishConfig.access": "public"(already set). - NuGet — create
Wevr.Sdkon nuget.org. Add GitHub secretNUGET_API_KEY. - Confirm GitHub Actions can run on this private repo (Actions enabled).
Release
- Bump versions in
pyproject.toml,src/wevr/__init__.py,js/package.json, anddotnet/Directory.Build.propsso they match the tag. git tag sdk-v0.5.1 && git push origin sdk-v0.5.1- Workflow
.github/workflows/publish-sdk.ymltests, then publishes to PyPI, npm, and NuGet.
Customers never need GitHub access. Runtime access is still gated by wk_….
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wevr_sdk-0.5.1.tar.gz.
File metadata
- Download URL: wevr_sdk-0.5.1.tar.gz
- Upload date:
- Size: 42.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeb5cb87b28d69274b3c6a2de2280c6ae80b13593dfbae7872eda222ef5d6c10
|
|
| MD5 |
e94a3e796724b63f6f5a975cf2a75aee
|
|
| BLAKE2b-256 |
43fef8b5cfd6a569873552ff0ff5623c0e9f0247b445cbec76cb27087cc6fc2a
|
Provenance
The following attestation bundles were made for wevr_sdk-0.5.1.tar.gz:
Publisher:
publish-sdk.yml on Weevir/Weevir
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wevr_sdk-0.5.1.tar.gz -
Subject digest:
eeb5cb87b28d69274b3c6a2de2280c6ae80b13593dfbae7872eda222ef5d6c10 - Sigstore transparency entry: 2602858671
- Sigstore integration time:
-
Permalink:
Weevir/Weevir@bd74b51f0f5b57d63ebcfb84f30ddaf2f45fe659 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Weevir
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@bd74b51f0f5b57d63ebcfb84f30ddaf2f45fe659 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file wevr_sdk-0.5.1-py3-none-any.whl.
File metadata
- Download URL: wevr_sdk-0.5.1-py3-none-any.whl
- Upload date:
- Size: 54.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bafde90bbec0bfb15fbe1db11a9b6d3c56f76ef7fffdef19a96890ac1e7bf2c0
|
|
| MD5 |
5c4ce8a92e0d04870fae85e733512010
|
|
| BLAKE2b-256 |
6fed519e541e2795e6d60949c1563fd3658f9b82f5cc8a2bbf5c8171aa595a84
|
Provenance
The following attestation bundles were made for wevr_sdk-0.5.1-py3-none-any.whl:
Publisher:
publish-sdk.yml on Weevir/Weevir
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wevr_sdk-0.5.1-py3-none-any.whl -
Subject digest:
bafde90bbec0bfb15fbe1db11a9b6d3c56f76ef7fffdef19a96890ac1e7bf2c0 - Sigstore transparency entry: 2602858860
- Sigstore integration time:
-
Permalink:
Weevir/Weevir@bd74b51f0f5b57d63ebcfb84f30ddaf2f45fe659 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Weevir
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@bd74b51f0f5b57d63ebcfb84f30ddaf2f45fe659 -
Trigger Event:
workflow_dispatch
-
Statement type: