npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@trustsig/types

v2.13.0

Published

Shared TypeScript types for the TrustSig SDK

Readme

@trustsig/types

TypeScript types for the TrustSig SDK: the verdict your server receives, the options each package takes, and the TrustSig Pro API shapes.

You rarely need to install this yourself. @trustsig/server re-exports all of it, and @trustsig/client and @trustsig/react depend on it. Install it directly to share TrustSig types between services, to type your own tooling against the TrustSig API, or to import TrustSigEnv in a frontend.

npm install @trustsig/types

Everything here is a type except the TrustSigEnv enum. Nothing touches window; window.TrustSig is declared by @trustsig/client.

Usage

import type { BotAnalysisResponse } from '@trustsig/types';

export function auditRecord(verdict: BotAnalysisResponse) {
  return {
    action: verdict.action,
    risk: verdict.risk?.score,
    device: verdict.identity?.device_id,
    reasons: verdict.risk?.reason_codes ?? [],
  };
}
import { TrustSigClient } from '@trustsig/client';
import { TrustSigEnv } from '@trustsig/types';

const trustsig = new TrustSigClient({ siteKey, env: TrustSigEnv.STAGING });

| Import | Contents | | --- | --- | | @trustsig/types | Everything, including the Pro types. | | @trustsig/types/pro | Pro types only. |

Core types

| Type | Description | | --- | --- | | TrustSigEnv | Enum: PROD, STAGING, DEV. | | TrustSigAction | 'ALLOW' \| 'CHALLENGE' \| 'BLOCK'. | | BotAnalysisResponse | The verdict verifyRemote returns. | | TrustSigErrorCode | TOKEN_MISSING, API_FAIL, MALFORMED_RESPONSE. TOKEN_EXPIRED, TOKEN_REUSED, and CRYPTO_FAIL remain in the union but are no longer produced. | | TrustSigOptions, TrustSigVerifyOptions | Options for new TrustSig() and verifyRemote(). | | TrustSigInclude, TrustSigDetailGroup | Values for the include option. | | TrustSigResponse | { request_id, token }, what the browser SDK hands you. | | TrustSigFlushOptions, TrustSigBehaviorHandle | Options for flushMouse and the value onBehaviorReady receives. | | BehaviorResponse | What getBehavior returns: TrustSigBehaviorResult and TrustSigBehaviorDevice. | | TrustSigScanResult, TrustSigGlobal | The raw script result and the shape of window.TrustSig. |

Verdict blocks

BotAnalysisResponse keeps action, is_bot, score, and issued_at stable on every account. The rest of the verdict sits in named blocks, all optional because accounts on the legacy contract receive none of them.

| Field | Type | Contents | | --- | --- | --- | | risk | TrustSigRisk | Continuous score, TrustSigRiskLevel, reason_codes, revision counters. | | identity | TrustSigIdentity | device_id, confidence, degraded, first and last sighting. | | device | TrustSigDevice | What the browser reported, split into screen, hardware, locale, and further groups. | | network | TrustSigNetwork | Location, connection_type, VPN, Tor, datacenter, and mobile flags, TLS. | | integrity | TrustSigIntegrity | Automation, anti-detect browser, tampering, and spoofing findings. | | behavior | TrustSigBehavior | mouse, the pointer-movement verdict. | | velocity | TrustSigVelocity | How often the device was seen in fixed windows. | | flags | TrustSigFlags | Flat booleans for one-line checks. |

Most device and network fields arrive only when requested with include. Each field's doc comment names the group that carries it.

An unmeasured field holds its type's zero (0, '', []). TrustSigDevice, TrustSigNetwork, TrustSigIdentity, TrustSigVelocity, and TrustSigSpoofing carry a measured map saying which values are real readings. The @trustsig/server README describes every field.

Reason codes

TrustSigReasonCode lists every code this release knows, and also accepts any string, so a code TrustSig adds later is never a type error and editors still autocomplete the known ones. TrustSigReasonCodeGroup names the groups: automation, integrity, environment, behavior, challenge, velocity, reputation, network, device, trust, token. Only trust holds positive findings. TrustSigReasonCodeCatalog and TrustSigReasonCodeDoc type the catalogue served at GET /api/v1/meta/reason-codes.

Pro types

Pro decisions are ProDecision ('ALLOW' | 'REVIEW' | 'BLOCK'), not TrustSigAction. Pro keys identify the project, so no Pro type carries a project id.

| Area | Types | | --- | --- | | Decisions and errors | ProDecision, ProErrorCode, ProCredentialScope | | Options | ProOptions, ProClientOptions, ProSessionStorage | | Verify | ProVerifyInput, ProVerifyResponse, ProClientResponse | | Events | ProEventKind, ProEventInput, ProEventVerdict, ProEventVelocity, ProReasonDetail | | Interactions | ProInteractionInput, ProInteractionsResponse | | Identity | ProIdentityConfidence, ProAccountTraits, ProDeviceJoin | | Verdict details | ProEnrichment, ProNamedSignals, ProBehavior, ProMouseBehavior, ProSpoof | | Duplicate accounts | ProAltVerdict, ProAltAccount, ProAltLink | | Request binding | ProRequestContext, ProTlsContext, ProBindingReport, ProBindingVerdict | | Action proofs | ProChallenge, ProChallengeOptions, ProProofResult, ProProofFailure, ProVerifyProofOptions | | Devices | ProEntity, ProEntityAccount, ProEntityAccountsResponse, ProEntityMouse, ProEntitySpoof, ProMouseSession, ProLinkageRun | | Rules | ProRule, ProRuleAction, ProRuleState, ProRulesVersion, ProRulesView | | Reputation and labels | ProReputationKind, ProReputationStatus, ProLabelReportKind, ProLabelValue, ProLabelSubjectType | | Telegram Mini Apps | ProTelegramInitData, ProTelegramVerification | | Operations | ProUsage, ProAnalyticsView, ProWebhookEvent, ProEngine, ProEnforcement, ProTrainingStatus |

Fields added after your release

BotAnalysisResponse, ProVerifyResponse, ProEventVerdict, and every verdict block carry an index signature, and the server SDK passes unknown response fields through. A field TrustSig adds is readable before this package declares it, typed as unknown:

const region = verdict.network?.some_new_field as string | undefined;

Related packages

MIT licensed.