truestamp-js 0.13.1
Install from the command line:
Learn more about npm packages
$ npm install @truestamp/truestamp-js@0.13.1
Install via package.json:
"@truestamp/truestamp-js": "0.13.1"
About this version
A zero-dependency Truestamp SDK written in Typescript that supports ES Modules, UMD, and CommonJS loaders and runs in Deno, Node.js, and modern browsers.
- Small library size
- No external dependencies
- Built with Typescript
- Promise based API
- Supports Deno (ESM), Node.js (CommonJS), and modern browsers (ESM, UMD)
- SkyPack CDN support
- JSDELIVR CDN support
- UNPKG CDN support
Here are some simple usage examples. Additional example code can be found in the
/examples
directory.
In your NPM project directory.
npm install @truestamp/truestamp-js --save
Require the @truestamp/truestamp-js
CommonJS module in your project and
initialize it with your api key.
const Truestamp = require("@truestamp/truestamp-js");
const TruestampClient = new Truestamp({ apiKey: "%yourApiKey%" });
TruestampClient.getHealth()
.then((data) => console.log(data))
.catch((err) => console.log(err));
Deno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust.
Import the @truestamp/truestamp-js
ESM module in your project via
SkyPack and initialize it with your
apiKey.
SkyPack Package Info
https://www.skypack.dev/view/@truestamp/truestamp-js
It is recommended to used a
pinned version
of the library when using SkyPack in production. Also, note the ?dts
suffix on
the URL to get the
SkyPack Automatic TypeScript
Declarations for Deno.
// Note the `?dts` param to provide the proper typings for Deno
import Truestamp from "https://cdn.skypack.dev/@truestamp/truestamp-js?dts";
const TruestampClient = new Truestamp({ apiKey: "%yourApiKey%" });
const hb = await TruestampClient.getHealth();
console.log(hb);
You can use a <script>
tag in the browser to load a specific version of the
library from several supported CDN's. Replace the pinned version in the link
with the version you use in your app. You can use the ES Modules or UMD builds
for browser support.
<!-- load from JSDELIVR CDN latest (using latest not recommended for production use, pin a version) -->
<!-- See : https://www.jsdelivr.com/package/npm/@truestamp/truestamp-js -->
<script src="https://cdn.jsdelivr.net/npm/@truestamp/truestamp-js@latest/dist/truestamp.umd.min.js"></script>
The JS files available for each version can be browsed at JSDELIVR
<!-- load from UNPKG CDN latest (using latest not recommended for production use, pin a version) -->
<!-- See : https://unpkg.com/browse/@truestamp/truestamp-js/ -->
<script src="https://unpkg.com/@truestamp/truestamp-js"></script>
There are working code examples for Deno, Node.js, and the Web in the /examples directory. Take a look at the examples/README.md for usage instructions.
We'd love you to join our network of contributors. Please read CONTRIBUTING.md for help getting started.
- Commit changes, merge PR's to
main
branch - Bump
version
field inpackage.json
- Cut a new release
- New release will trigger workflow to build, test, and publish package to Github Package Registry and NPM.js.
We expect all members of the community to respect our Code of Conduct at all times.
Copyright © 2021-2022 Truestamp Inc. All Rights Reserved.