Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

@kilpi/core

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kilpi/core

Kilpi Core · Kilpi is the authorization framework for full-stack TypeScript applications, designed for flexible, powerful, agnostic, intuitive and developer friendly authorization.

Source
npmnpm
Version
0.19.0
Version published
Weekly downloads
22
-69.01%
Maintainers
1
Weekly downloads
 
Created
Source

🐢 Kilpi — Authorization made simple

Read the docs to get started

Kilpi is the open-source TypeScript authorization library designed for developers who need flexible, powerful, and intuitive authorization.

Designed and created by Jussi Nevavuori with ❤️ in Brisbane & Helsinki

NPM Downloads NPM Version GitHub Repo stars

Features

  • Server-first authorization
  • Framework agnostic
  • Auth provider agnostic
  • Policies as code
  • Async policies
  • Supports any authorization model
  • Protected queries
  • Plugin API & Library
  • Developer friendly API
  • 100% Type-safe

Installation guides

...or any other framework - Kilpi is easy to integrate into any TypeScript application.

Examples

Define policies declaratively and authorize actions with one line

// Kilpi.ts
export const Kilpi = createKilpi({
  // (1) Connect your authentication provider with subject adapter
  async getSubject() {
    return myAuthProvider.getCurrentUser();
  },
  // (2) Define all policies
  policies: {
    documents: {
      update(user, doc: Document) {
        if (!user) return deny({ message: "Unauthenticated" });
        return user.id === doc.ownerId ? grant(user) : deny();
      },
    },
  },
});

// (3) Protect with one-liners

// Option 1: Succeed or throw
const user = await Kilpi.authorize("documents:update", document);
// Option 2: Authorization as boolean
const isAuthorized = await Kilpi.isAuthorized("posts:comment", post);
// Option 3: Full authorization decision object with all metadata
const decision = await Kilpi.getAuthorizationDecision("comments:delete", comment);

Continue learning about

  • Plugins
  • Protecting queries, actions, UI, pages, routes, ...
  • Components

And much more.

Read the docs to get started

Keywords

fine-grained

FAQs

Package last updated on 11 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts