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

@virtualsnake9/themis-sdk

v0.1.0

Published

Cliente TypeScript para conectar backends al motor de políticas Themis

Downloads

156

Readme

@virtualsnake9/themis-sdk

Cliente TypeScript para que cualquier backend (Kairo Sign, Graph Flow, Zyta-be, etc.) use el motor de políticas Themis sin armar HTTP a mano.

Themis no guarda archivos (PDFs siguen en R2/disco del módulo). Solo roles, permisos y bindings recurso ↔ roles.


Instalación

pnpm add @virtualsnake9/themis-sdk
# o
npm install @virtualsnake9/themis-sdk

Configuración

Variables de entorno típicas en el servicio consumidor:

| Variable | Ejemplo | Uso | |----------|---------|-----| | THEMIS_API_URL | http://localhost:3001 | URL del API Themis | | THEMIS_SERVICE_TOKEN | JWT de cuenta de servicio | Bearer en server-to-server |

La cuenta de servicio debe ser miembro del tenant con permisos authz:evaluate, resources:write, members:write (o rol tenant-admin).


Uso básico (cualquier Node backend)

import { createThemisClient, ThemisAccessDeniedError } from '@virtualsnake9/themis-sdk';

const themis = createThemisClient({
  baseUrl: process.env.THEMIS_API_URL!,
  token: process.env.THEMIS_SERVICE_TOKEN!,
});

await themis.assertCanAccessResource({
  tenantId,
  userId,
  resourceType: 'document',
  resourceId: documentId,
  action: 'read',
});

NestJS

import { ThemisModule, ThemisService } from '@virtualsnake9/themis-sdk/nest';

ThemisModule.forRoot({
  baseUrl: process.env.THEMIS_API_URL!,
  token: process.env.THEMIS_SERVICE_TOKEN!,
});

API del cliente

| Método | Cuándo usarlo | |--------|----------------| | canAccessResource / assertCanAccessResource | Antes de leer/mostrar un recurso | | bindResource / unbindResource | Restringir / liberar por roles | | addMemberRole / removeMemberRole | Asignar/quitar rol en flujos | | findMemberByEmail | Buscar miembro | | evaluateAccess | Check con permission explícito | | getResourceBinding | Ver roles de un recurso |


Convención resourceType / resourceId

| Módulo | resourceType | resourceId | |--------|--------------|------------| | Kairo Sign | document | UUID del doc en Sign | | Graph Flow | flow | UUID del flujo | | Zyta | expediente | id del expediente |


MCP vs SDK

| Herramienta | Repo | Para quién | |-------------|------|------------| | @virtualsnake9/themis-mcp | themis-mcp | Agentes Cursor | | @virtualsnake9/themis-sdk | este paquete | Backends en runtime |


Más documentación

  • AGENTS.md — guía para agentes de IA
  • Repo API: themis