Scan your whole stack
Are you using schematichq?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.4.11
schematichq was last scanned on 23 Nov 2026 at version 1.4.11. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.4.11 LATEST | 23 Nov 2026 | 1 rule fired |
| 1.4.10 | 17 Nov 2026 | 1 rule fired |
| 1.4.9 | 9 Nov 2026 | 1 rule fired |
| 1.4.8 | 2 Nov 2026 | Not shown |
| 1.4.7 | 28 Oct 2026 | Not shown |
Findings for v1.4.11. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The package includes a WebAssembly (.wasm) module. It cannot be reviewed as source, but it runs sandboxed inside the JavaScript runtime and can access only what the host code gives it. WebAssembly is common in parsers, codecs and cryptography libraries. Shown for awareness.
LOWThe score describes 1.4.11; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
The Schematic Python Library provides convenient access to the Schematic API from applications written in Python.
The library includes type definitions for all request and response fields, and offers both synchronous and asynchronous clients powered by httpx.
schematichq to your project's build file:pip install schematichq
# or
poetry add schematichq
Issue an API key for the appropriate environment using the Schematic app.
Using this secret key, initialize a client in your application:
from schematic.client import Schematic
client = Schematic("YOUR_API_KEY")
The SDK exports an async client for non-blocking API calls with automatic background event processing. The async client features lazy initialization - you can start using it immediately without manual setup.
The easiest way to use the async client - just create and use it directly:
import asyncio
from schematic.client import AsyncSchematic
async def main():
# Create client - no initialize() needed!
client = AsyncSchematic("YOUR_API_KEY")
# Use immediately - auto-initializes on first call
is_enabled = await client.check_flag(
"new-feature",
company={"id": "company-123"},
user={"id": "user-456"}
)
if is_enabled:
print("New feature is enabled!")
# Track usage
await client.track(
event="feature-used",
company={"id": "company-123"},
user={"id": "user-456"}
)
# Always shutdown when done
await client.shutdown()
asyncio.run(main())
Use the async client as a context manager for automatic lifecycle management:
import asyncio
from schematic.client import AsyncSchematic
async def main():
async with AsyncSchematic("YOUR_API_KEY") as client:
# Client auto-initializes and will auto-shutdown
is_enabled = await client.check_flag(
"feature-flag",
company={"id": "company-123"}
)
await client.identify(
keys={"id": "company-123"},
name="Acme Corp"
)
# Automatic cleanup on exit
asyncio.run(main())
For production applications that need precise control over initialization timing:
import asyncio
from schematic.client import AsyncSchematic
# Web application example
client = AsyncSchematic("YOUR_API_KEY")
async def startup():
"""Call during application startup"""
await client.initialize() # Start background tasks now
print("Schematic client ready")
async def shutdown():
"""Call during application shutdown"""
await client.shutdown() # Stop background tasks and flush events
print("Schematic client stopped")
async def handle_request():
"""Handle individual requests"""
# Client is already initialized - this will be fast
is_enabled = await client.check_flag(
"feature-flag",
company={"id": "company-123"}
)
return {"feature_enabled": is_enabled}
All errors thrown by the SDK will be subclasses of ApiError.
try:
client.companies.get_company(
company_id="company_id",
)
except schematic.core.ApiError as e: # Handle all errors
print(e.status_code)
print(e.body)
A number of these examples use keys to identify companies and users. Learn more about keys here.
Create or update users and companies using identify events.
from schematic import EventBodyIdentifyCompany
from schematic.client import Schematic
client = Schematic("YOUR_API_KEY")
client.identify(
keys={
"email": "wcoyote@acme.net",
"user_id": "your-user-id",
},
company=EventBodyIdentifyCompany(
keys={"id": "your-company-id"},
name="Acme Widgets, Inc.",
traits={
"city": "Atlanta",
},
),
name="Wile E. Coyote",
traits={
"login_count": 24,
"is_staff": false,
},
)
This call is non-blocking and there is no response to check.
Track activity in your application using track events; these events can later be used to produce metrics for targeting.
from schematic.client import Schematic
client = Schematic("YOUR_API_KEY")
client.track(
event="some-action",
user={"user_id": "your-user-id"},
company={"id": "your-company-id"},
)
Async client:
import asyncio
from schematic.client import AsyncSchematic
async def main():
async with AsyncSchematic("YOUR_API_KEY") as client:
await client.track(
event="some-action",
user={"user_id": "your-user-id"},
company={"id": "your-company-id"},
)
asyncio.run(main())
These calls are non-blocking and there is no response to check.
If you want to record large numbers of the same event at once, or perhaps measure usage in terms of a unit like tokens or memory, you can optionally specify a quantity for your event:
client.track(
event="some-action",
user={"user_id": "your-user-id"},
company={"id": "your-company-id"},
quantity=10,
)
Although it is faster to create companies and users via identify events, if you need to handle a response, you can use the companies API to upsert companies. Because you use your own identifiers to identify companies, rather than a Schematic company ID, creating and updating companies are both done via the same upsert operation:
from schematic.client import Schematic
client = Schematic("YOUR_API_KEY")
client.companies.upsert_company(
keys={"id": "your-company-id"},
name="Acme Widgets, Inc.",
traits={
"city": "Atlanta",
"high_score": 25,
"is_active": true,
},
)
You can define any number of company keys; these are used to address the company in the future, for example by updating the company's traits or checking a flag for the company.
You can also define any number of company traits; these can then be used as targeting parameters.
Similarly, you can upsert users using the Schematic API, as an alternative to using identify events. Because you use your own identifiers to identify users, rather than a Schematic user ID, creating and updating users are both done via the same upsert operation:
from schematic.client import Schematic
client = Schematic("YOUR_API_KEY")
client.companies.upsert_user(
keys={
"email": "wcoyote@acme.net",
"user_id": "your-user-id",
},
name="Wile E. Coyote",
traits={
"city": "Atlanta",
"high_score": 25,
"is_active": true,
},
company={"id": "your-company-id"},
)
You can define any number of user keys; these are used to address the user in the future, for example by updating the user's traits or checking a flag for the user.
You can also define any number of user traits; these can then be used as targeting parameters.
When checking a flag, you'll provide keys for a company and/or keys for a user. You can also provide no keys at all, in which case you'll get the default value for the flag.
from schematic.client import Schematic
client = Schematic("YOUR_API_KEY")
client.check_flag(
"some-flag-key",
company={"id": "your-company-id"},
user={"user_id": "your-user-id"},
)
Schematic can send webhooks to notify your application of events. To ensure the security of these webhooks, Schematic signs each request using HMAC-SHA256. The Python SDK provides utility functions to verify these signatures.
When your application receives a webhook request from Schematic, you should verify its signature to ensure it's authentic. The SDK provides simple functions to verify webhook signatures. Here's how to use them in different frameworks:
from flask import Flask, request, jsonify
from schematic.webhook_utils import verify_webhook_signature, WebhookSignatureError
app = Flask(__name__)
@app.route('/webhooks/schematic', methods=['POST'])
def schematic_webhook():
try:
# Each webhook has a distinct secret; you can access this via the Schematic app
webhook_secret = "your-webhook-secret"
# Verify the webhook signature
verify_webhook_signature(request, webhook_secret)
# Process the webhook payload
data = request.json
print(f"Webhook verified: {data}")
return "", 200
except WebhookSignatureError as e:
print(f"Webhook verification failed: {str(e)}")
return jsonify({"error": str(e)}), 400
except Exception as e:
print(f"Error processing webhook: {str(e)}")
return jsonify({"error": "Internal server error"}), 500
if __name__ == '__main__':
app.run(port=3000)
from django.http import JsonResponse, HttpResponse
from django.views.decorators.csrf import csrf_exempt
from schematic.webhook_utils import verify_webhook_signature, WebhookSignatureError
@csrf_exempt
def schematic_webhook(request):
if request.method != 'POST':
return HttpResponse(status=405)
try:
# Each webhook has a distinct secret; you can access this via the Schematic app
webhook_secret = "your-webhook-secret"
# Verify the webhook signature
verify_webhook_signature(request, webhook_secret)
# Process the webhook payload
data = request.json
print(f"Webhook verified: {data}")
return HttpResponse(status=200)
except WebhookSignatureError as e:
print(f"Webhook verification failed: {str(e)}")
return JsonResponse({"error": str(e)}, status=400)
except Exception as e:
print(f"Error processing webhook: {str(e)}")
return JsonResponse({"error": "Internal server error"}, status=500)
from fastapi import FastAPI, Request, Response, HTTPException, Depends
from schematic.webhook_utils import verify_webhook_signature, WebhookSignatureError
app = FastAPI()
async def verify_signature(request: Request):
# Each webhook has a distinct secret; you can access this via the Schematic app
webhook_secret = "your-webhook-secret"
try:
# Get the raw body
body = await request.body()
# Verify the webhook signature
verify_webhook_signature(request, webhook_secret, body)
except WebhookSignatureError as e:
raise HTTPException(status_code=400, detail=str(e))
@app.post("/webhooks/schematic")
async def schematic_webhook(request: Request, _: None = Depends(verify_signature)):
# Process the webhook payload
data = await request.json()
print(f"Webhook verified: {data}")
return Response(status_code=200)
If you need to verify a webhook signature outside of the context of a web request, you can use the verify_signature function:
from schematic.webhook_utils import verify_signature, WebhookSignatureError
def verify_webhook_manually(body: str, signature: str, timestamp: str, secret: str):
try:
# Verify the signature
verify_signature(body, signature, timestamp, secret)
return True
except WebhookSignatureError as e:
print(f"Webhook verification failed: {str(e)}")
return False
A browser SDK uses a publishable key, which anyone can read from your page, so on its own it can't prove which company or user it's acting for. When an environment requires context signatures, the API only accepts a publishable-key request whose company and user your backend has signed with the environment's secret API key. The browser SDK asks your backend for the signature through its getContextSignature option and sends it in the X-Schematic-Context-Sig header.
Sign the logged-in user's own company and user, read from your session. Don't sign whatever company or user the browser asks for, or anyone could get a signature for another company.
import os
from flask import Flask, jsonify
from schematic.context_signature import sign_context
app = Flask(__name__)
@app.route("/api/schematic/sign", methods=["POST"])
def sign_schematic_context():
session = get_session() # however your app identifies the logged-in user
if session is None:
return jsonify({"error": "Unauthorized"}), 401
signature = sign_context(
os.environ["SCHEMATIC_SECRET_KEY"],
{
"company": {"id": session.company_id},
"user": {"id": session.user_id},
},
)
return jsonify({"signature": signature})
The company and user keys must match the context you give the browser SDK exactly, or the API rejects the signature. A signature is valid for 10 minutes by default; set a different lifetime, up to an hour, with lifetime_seconds, and the start time with issued_at. The browser SDK reuses a signature until shortly before it expires, then asks for a new one. sign_context raises a ContextSignatureError when the secret is missing, the lifetime is out of range, or a key or value isn't a string.
By default, the client will do some local caching for flag checks. If you would like to change this behavior, you can do so using an initialization option to specify the max size of the cache (in terms of number of entries) and the max age of the cache (in milliseconds):
from schematic.client import LocalCache, Schematic
cache_size = 100
cache_ttl = 1000 # in milliseconds
config = SchematicConfig(
cache_providers=[LocalCache[bool](cache_size, cache_ttl)],
)
client = Schematic("YOUR_API_KEY", config)
You can also disable local caching entirely; bear in mind that, in this case, every flag check will result in a network request:
from schematic.client import Schematic
config = SchematicConfig(cache_providers=[])
client = Schematic("YOUR_API_KEY", config)
You may want to specify default flag values for your application, which will be used if there is a service interruption or if the client is running in offline mode (see below):
from schematic.client import Schematic
config = SchematicConfig(flag_defaults={"some-flag-key": True})
client = Schematic("YOUR_API_KEY", config)
You can also preflight a check: ask whether an action would be allowed, by
evaluating the flag against usage the action has not recorded yet. Pass
usage for any numeric condition, or event_usage when you know which event
subtype the usage lands on:
from schematic.client import CheckFlagOptions, EventUsage, Schematic
client = Schematic("YOUR_API_KEY")
allowed = client.check_flag(
"some-flag-key",
company={"id": "your-company-id"},
options=CheckFlagOptions(usage=1000),
)
allowed = client.check_flag(
"some-flag-key",
company={"id": "your-company-id"},
options=CheckFlagOptions(
event_usage=EventUsage(event_subtype="inference_tokens", quantity=1000),
),
)
Preflighted checks are never served from, or written to, the local flag check cache: the answer is specific to the usage you simulated.
In development or testing environments, you may want to avoid making network requests to the Schematic API. You can run Schematic in offline mode by specifying the offline option; in this case, it does not matter what API key you specify:
from schematic.client import Schematic
config = SchematicConfig(offline=True)
client = Schematic("", config)
Offline mode works well with flag defaults:
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.