Socket
Socket
Sign inDemoInstall

@truestamp/client

Package Overview
Dependencies
3
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @truestamp/client

## Description


Version published
Maintainers
1
Created

Readme

Source

Truestamp Client

Description

A small Truestamp API wrapper library, written in Typescript, for usage in Deno and Node.js.

Usage of this library requires an active Truestamp account, and an associated API key.

Features

  • Small library size
  • Zero dependencies
  • Built with Typescript
  • Promise based API (async/await)
  • Supports Deno (ESM), Node.js (CommonJS)
  • esm.sh CDN support
  • SkyPack CDN support
  • JSDELIVR CDN support
  • UNPKG CDN support

Installation

How to install and use the TruestampClient in different runtime environments.

Node.js (CommonJS)

In your NPM project root.

npm install @truestamp/client --save

Require the @truestamp/client CommonJS module in your project and initialize it with an api key.

const { TruestampClient } = require("@truestamp/client")
...

Deno (ES Modules)

Import the @truestamp/client ESM module in your project via esm.sh and initialize it with an apiKey.

// Tip : Load module from esm.sh CDN, pinned to a specific version.
import { TruestampClient } from "https://esm.sh/@truestamp/client@0.15.0"
...

API Usage Example

The first step is to instantiate an instance of the TruestampClient class, passing it your apiKey as an argument.

The client class instance the makes available a number of functions, each of which accepts typed arguments and returns typed response Objects.

// See installation section for your runtime environment.
import { TruestampClient } from "@truestamp/client"

const ts = new TruestampClient({ apiKey: "%yourApiKey%" })

const myHash =
  "e728e4adeb8c0606fce4686552338622efeb8c63b53d072a323a4914d1aa5c07"

// Create new Item
const resp = await ts.createItem(
  {
    itemData: [
      {
        hash: myHash,
        hashType: "sha-256",
      },
    ],
  },
  { skipCF: false, skipOE: false }
)

// Success! `resp` contains good response JSON
// of the appropriate type.
console.log("createItem", resp)

Examples

There are working code examples for Deno and Node.js in the /examples directory. Take a look at the examples/README.md for usage instructions.

Truestamp Community Hub

Please see our Github organization's profile at github.com/truestamp for quick access to links related to these and other important topics.

  • Filing Issues (bug reports & feedback)
  • Community Discussions
  • Security Reporting
  • Code of Conduct
  • Code Contributions
  • Public roadmap
  • Support

Copyright © 2019-2023 Truestamp Inc. All Rights Reserved.

Keywords

FAQs

Last updated on 19 Jan 2023

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc