Skip to main content
Most integrations only need two things from these packages:
  • LocalDevSigner.fromKeyRef(...) to provide a signer to middleware, gateway, or audit setup
  • initTracing(...) to point Sec0 traces at your OTLP collector

signer

LocalDevSigner

MethodSignatureDescription
LocalDevSigner.fromKeyRef(keyRef: string) => LocalDevSignerLoad a base64 Ed25519 key from a file://... path

Signer interface

MemberTypeDescription
keyIdstringKey identifier
sign`(data: Uint8Array) => Promise<Uint8Array>Uint8Array`Sign bytes

Example

import { LocalDevSigner } from "sec0-sdk/signer";

const signer = LocalDevSigner.fromKeyRef("file://./.sec0/keys/ed25519.key");

console.log("keyId:", signer.keyId);
fromKeyRef(...) only accepts file:// paths and honors the allowed key directories controlled by SEC0_SIGNER_KEY_DIRS.

otel

OTelConfig

KeyTypeRequiredDescription
endpointstringYesOTLP/gRPC collector endpoint
serviceNamestringYesService name
serviceVersionstringYesService version
environmentstringYesEnvironment name
tenantstringYesTenant identifier
sample.successnumber (0-1)YesSuccess sampling ratio
sample.errornumber (0-1)NoError sampling ratio

initTracing

import { initTracing } from "sec0-sdk/otel";

initTracing({
  endpoint: "https://your-otlp-endpoint",
  serviceName: "orders-server",
  serviceVersion: "1.0.0",
  environment: "dev",
  tenant: "my-app",
  sample: { success: 1, error: 1 },
});
Most Sec0 integrations do not need manual span helpers. Decorators, middleware, and gateway integrations already emit the expected spans and attributes for you.