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
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.
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
.
import { TruestampClient } from "@truestamp/client"
const ts = new TruestampClient({ apiKey: "%yourApiKey%" })
const myHash =
"e728e4adeb8c0606fce4686552338622efeb8c63b53d072a323a4914d1aa5c07"
const resp = await ts.createItem(
{
itemData: [
{
hash: myHash,
hashType: "sha-256",
},
],
},
{ skipCF: false, skipOE: false }
)
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.
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
Legal
Copyright © 2019-2023 Truestamp Inc. All Rights Reserved.