Registry / security / signicat-client-ts

signicat-client-ts

JSON →
library1.4.0jsnpmunverified

Community-maintained TypeScript client for the Signicat Authentication REST API (v1.4.0, last updated 2025). Automates OAuth2 token lifecycle — issuance, caching, renewal — with zero-touch configuration. Built on Axios with full TypeScript type definitions. Differentiator: removes the boilerplate of manual token handling vs. raw HTTP or OpenAPI-generated clients. Supports redirect, embedded, and headless authentication flows. Node.js >=14.0.0, ESM-only. Weekly releases tracked on npm.

npm install signicat-client-ts
INSTALL
IMPORT
SIG · SIGNICAT-CLIENT-TS
S
signicat-client-ts
securityjavascriptv1.4.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.

SignicatClient
import { SignicatClient } from 'signicat-client-ts'
import SignicatClient from 'signicat-client-ts'
Named export, not default. ESM-only; CommonJS require() not supported.
ApiError
import { ApiError } from 'signicat-client-ts'
import { ApiError } from 'signicat-client-ts/ApiError'
Direct named export from package root, not a subpath.
SessionRequestDto
import { SessionRequestDto } from 'signicat-client-ts'
const { SessionRequestDto } = require('signicat-client-ts')
TypeScript type; CJS require() will break in bundlers. Use isolatedModules.

Initializes the Signicat client, configures OAuth2 token management, and creates an authentication session with error handling using ApiError.

import { SignicatClient, ApiError, SessionDataDto } from 'signicat-client-ts'; SignicatClient.configureAuth({ clientId: process.env.SIGNICAT_CLIENT_ID ?? '', clientSecret: process.env.SIGNICAT_CLIENT_SECRET ?? '', }); const client = new SignicatClient(); async function createSession(): Promise<void> { const sessionRequest = { flow: 'redirect', allowedProviders: ['nbid', 'sbid'], requestedAttributes: ['firstName', 'lastName', 'email', 'dateOfBirth'], language: 'en', callbackUrls: { success: 'https://example.com/success', abort: 'https://example.com/abort', error: 'https://example.com/error', }, }; try { const session: SessionDataDto = await client.authenticationSession.createSession(sessionRequest); console.log('Session created:', session); } catch (error) { if (error instanceof ApiError) { console.error('API Error:', error.status, error.message); } else { console.error('Unexpected error:', error); } } } createSession();
Debug
Known issues
gotchaconfigureAuth() is static and must be called once before any SignicatClient instantiation; calling it multiple times overwrites previous config.
fix
Call SignicatClient.configureAuth() once at application startup, typically in an initialization module.
affects: >=1.0.0
gotchaThe client does not validate request payloads on the client side; invalid fields are only caught at runtime via API errors.
fix
Use TypeScript type checks or runtime validation libraries (e.g., zod) to validate request objects before sending.
affects: >=1.0.0
deprecatedThe `VERSION` option in SignicatClient constructor defaults to '1'; future API versions may require explicit versioning.
fix
Set `VERSION: '2'` or later explicitly when Signicat APIs deprecate v1.
affects: >=1.4.0
gotchaToken renewal uses an expiration buffer (default 60 seconds). If network latency exceeds this, a 401 error may occur.
fix
Increase `expirationBuffer` in configureAuth() to 120 or more for high-latency environments.
affects: >=1.0.0
breakingVersion 1.0.0 migrated from `request`-based client to Axios; custom interceptors from previous versions will not work.
fix
Use Axios interceptors via `client.instance.interceptors` instead (not documented but available).
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: signicat_client_ts_1.SignicatClient is not a constructor
Using default import instead of named import.
fix
Use `import { SignicatClient } from 'signicat-client-ts'` instead of `import SignicatClient from 'signicat-client-ts'`.
Error: configureAuth must be called before creating client instance
Creating a SignicatClient without calling configureAuth first.
fix
Call `SignicatClient.configureAuth({ clientId: '...', clientSecret: '...' })` before `new SignicatClient()`.
AxiosError: Request failed with status code 401
Invalid or expired client credentials, or token URL misconfigured.
fix
Verify clientId and clientSecret are correct. Check tokenUrl (default: 'https://api.signicat.com/auth/open/connect/token'). Ensure network allows outbound HTTPS.
TS2307: Cannot find module 'signicat-client-ts' or its corresponding type declarations.
Missing package or TypeScript not configured to resolve types.
fix
Run `npm install signicat-client-ts`. Ensure tsconfig.json has `moduleResolution: 'node'` and `esModuleInterop: true`.
Upgrade
Version history
1.4.0latest on npm
Audit
Dependencies
axiosrequiredHTTP client for REST API calls and token management
Agent activity
12 hits · last 30 days
node
12
Resources