Skip to main content

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: WevrPostgresConnector
JS/.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

  1. Install the package on a host / container / region
  2. Set the same org WEVR_LICENSE_KEY
  3. Set a unique pair: name + type for that install
  4. Run traffic — envelopes land under org_id with deployment key {name}/{type}
  5. 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

  1. Log in to the Weevir dashboard
  2. Open Settings — the license key is shown on the org card as WEVR_LICENSE / license_key
  3. Store it as WEVR_LICENSE_KEY (env var / secrets manager). Do not put wk_… in dashboard tenantId query params — the API expects the resolved org_id UUID 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

  1. PyPI — create the project wevr-sdk (or confirm the name is free). Add GitHub secret PYPI_API_TOKEN (Trusted Publishing is preferred).
  2. npm — create the @wevr org (or change the package name in js/package.json). Add GitHub secret NPM_TOKEN with publish rights. Scoped packages need "publishConfig.access": "public" (already set).
  3. NuGet — create Wevr.Sdk on nuget.org. Add GitHub secret NUGET_API_KEY.
  4. Confirm GitHub Actions can run on this private repo (Actions enabled).

Release

  1. Bump versions in pyproject.toml, src/wevr/__init__.py, js/package.json, and dotnet/Directory.Build.props so they match the tag.
  2. git tag sdk-v0.5.1 && git push origin sdk-v0.5.1
  3. Workflow .github/workflows/publish-sdk.yml tests, 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

wevr_sdk-0.5.1.tar.gz (42.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wevr_sdk-0.5.1-py3-none-any.whl (54.5 kB view details)

Uploaded Python 3

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

Hashes for wevr_sdk-0.5.1.tar.gz
Algorithm Hash digest
SHA256 eeb5cb87b28d69274b3c6a2de2280c6ae80b13593dfbae7872eda222ef5d6c10
MD5 e94a3e796724b63f6f5a975cf2a75aee
BLAKE2b-256 43fef8b5cfd6a569873552ff0ff5623c0e9f0247b445cbec76cb27087cc6fc2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for wevr_sdk-0.5.1.tar.gz:

Publisher: publish-sdk.yml on Weevir/Weevir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for wevr_sdk-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bafde90bbec0bfb15fbe1db11a9b6d3c56f76ef7fffdef19a96890ac1e7bf2c0
MD5 5c4ce8a92e0d04870fae85e733512010
BLAKE2b-256 6fed519e541e2795e6d60949c1563fd3658f9b82f5cc8a2bbf5c8171aa595a84

See more details on using hashes here.

Provenance

The following attestation bundles were made for wevr_sdk-0.5.1-py3-none-any.whl:

Publisher: publish-sdk.yml on Weevir/Weevir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 files

0.5.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page