Socket
Book a DemoInstallSign in
Socket

@predicate/core

Package Overview
Dependencies
Maintainers
5
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@predicate/core

Core utilities for interacting with Predicate API

0.1.5
latest
npmnpm
Version published
Maintainers
5
Created
Source

Predicate SDK

npm version License: MIT

@predicate/core

The core package is a TypeScript client for directly interacting with the Predicate API. It handles:

  • Policy evaluation and verification
  • Authentication and API communication
  • Request validation and error handling
  • Works in any JavaScript/TypeScript environment (Node.js, browser, etc.)

Use this package when you need to integrate Predicate's policy evaluation capabilities into your backend services or when building custom frontend integrations without React.

Installation

Core Package

npm install @predicate/core

Core Package Example

import {PredicateClient, PredicateRequest} from '@predicate/core';

const predicateClient = new PredicateClient({
    apiUrl: 'https://api.predicate.io/',
    apiKey: process.env.PREDICATE_API_KEY!
});

if (!process.env.PREDICATE_API_KEY) {
    console.error("Error: PREDICATE_API_KEY is not set.");
    process.exit(1);
}



const request: PredicateRequest = {
    from: '0xSenderAddress',
    to: '0xPredicatedContractAddress',
    data: '0xEncodedArguments',
    msg_value: '0'
}

async function main() {
    const evaluationResult = await predicateClient.evaluatePolicy(request);
    console.log("Policy evaluation result:", evaluationResult);
}

main().catch((error) => {
    console.error("Error evaluating policy:", error);
    process.exit(1);
});

Documentation

For detailed documentation, visit docs.predicate.io.

Features

Core Package

  • Easy integration with Predicate network
  • Policy evaluation and verification
  • TypeScript support for improved developer experience
  • Error handling utilities
  • Request validation

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

predicate

FAQs

Package last updated on 20 Aug 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.