Registry / security / originstamp-client-fetch

originstamp-client-fetch

JSON →
library3.0.0jsnpmunverified

TypeScript Fetch client for the OriginStamp timestamping service (v3.0.0). Provides an ESM-only, typed API using native fetch, targeting modern Node.js and browser environments. Official client maintained by OriginStamp. Replaces older axios-based clients with a fetch-based implementation for better performance and compatibility. Supports creating and verifying timestamps via the OriginStamp API (apidev.originstamp.com). Ships TypeScript types. Release cadence is low; this version is a major rewrite.

npm install originstamp-client-fetch
INSTALL
IMPORT
SIG · ORIGINSTAMP-CLIENT
O
originstamp-client-fetch
securityjavascriptv3.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Configuration
import { Configuration } from 'originstamp-client-fetch'
const { Configuration } = require('originstamp-client-fetch')
ESM-only since v3; CommonJS require() will fail.
TimestampApi
import { TimestampApi } from 'originstamp-client-fetch'
import TimestampApi from 'originstamp-client-fetch'
TimestampApi is a named export, not default.
TimestampResponse
import type { TimestampResponse } from 'originstamp-client-fetch'
import { TimestampResponse } from 'originstamp-client-fetch'
TimestampResponse is a type; use import type for best practices.

Creates a timestamp using the SHA-256 hash of 'example' via the OriginStamp API.

import { Configuration, TimestampApi } from 'originstamp-client-fetch'; const apiKey = process.env.ORIGINSTAMP_API_KEY ?? ''; const config = new Configuration({ basePath: 'https://apidev.originstamp.com', apiKey: () => apiKey }); const api = new TimestampApi(config); (async () => { try { const response = await api.createTimestamp({ timestampRequest: { sha256: ['example'] } }); console.log('Timestamp created:', response); } catch (error) { console.error('Error:', error); } })();
Debug
Known issues
breakingv3.0.0 is ESM-only and uses fetch; does not support CommonJS (require) or older Node.js (<18) without node-fetch polyfill.
fix
Use import syntax and ensure Node.js >=18 or install node-fetch and use a dynamic import or ESM wrapper.
affects: >=3.0.0
breakingv3.0.0 drops axios dependency; request/response types may differ from v2.
fix
Update API call patterns and types as per v3 docs. The method signature changed: createTimestamp now takes an object with a timestampRequest property.
affects: >=3.0.0
deprecatedv2.x (axios-based) is deprecated; migrate to v3.
fix
Upgrade to v3 and update imports/configuration.
affects: <3.0.0
gotchaThe apiKey config function is invoked on every request; do not expose static key in client-side code.
fix
Use environment variables or a secure backend to supply the API key.
affects: >=3.0.0
Errors
Common errors & fixes
error TS2307: Cannot find module 'originstamp-client-fetch' or its corresponding type declarations.
Missing TypeScript type definitions or incorrect module resolution.
fix
Ensure the package is installed: npm install originstamp-client-fetch@3.0.0 --save. For Node.js projects, set 'moduleResolution' to 'node' or 'node16' in tsconfig.json.
error: TypeError: fetch is not defined
Node.js version <18 does not have native fetch; package expects a fetch implementation.
fix
Install node-fetch and add a global polyfill, or upgrade to Node.js 18+. If using node-fetch, import it and set globally (e.g., globalThis.fetch = fetch).
TypeError: Configuration is not a constructor
Using CommonJS require() in Node.js when package is ESM-only.
fix
Use import { Configuration } from 'originstamp-client-fetch' or use dynamic import().
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
node-fetchoptionalnative fetch not available in older Node versions (pre-18)
Agent activity
14 hits · last 30 days
node
14
Resources
originstamp-client-fetch — npm install originstamp-client-fetch · libregistry