Registry / payments / synapsenode

synapsenode

JSON →
library2.0.0-beta.11jsnpmunverified

Node.js client library for SynapseFI REST API v3.1, built with TypeScript for improved developer experience. Current version is 2.0.0-beta.11, released as a major version rewrite that is backward compatible. Supports both sandbox and production environments, with key management via environment variables. Differentiators include TypeScript support (first-party types), Promise-based async operations, and comprehensive coverage of SynapseFI's payments and financial APIs. Release cadence is beta-phase with ongoing updates.

npm install synapsenode
INSTALL
IMPORT
SIG · SYNAPSENODE
S
synapsenode
paymentsjavascriptv2.0.0-beta.11
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.

Client
import { Client } from 'synapsenode'
const Synapse = require('synapsenode'); const Client = Synapse.Client;
Since v2.0.0-beta, named export is available via ESM; CommonJS pattern still works but is legacy.
Synapse (default)
import Synapse from 'synapsenode'
const Synapse = require('synapsenode').default;
Default import in ESM; CJS require returns an object with Client property, not the default export.
types (e.g., IClientOptions)
import type { IClientOptions } from 'synapsenode'
import { IClientOptions } from 'synapsenode' (without type keyword)
Use import type for TypeScript interfaces to avoid bundling runtime code.

Initializes a Synapse Client in sandbox mode using environment variables and creates a new user.

import Synapse from 'synapsenode'; // or const Synapse = require('synapsenode') const client = new Synapse.Client({ client_id: process.env.CLIENT_ID ?? '', client_secret: process.env.CLIENT_SECRET ?? '', fingerprint: process.env.FINGERPRINT ?? '', ip_address: '127.0.0.1', isProduction: false }); async function createUser() { try { const user = await client.users.create({ logins: [{ email: 'test@example.com' }], phone_numbers: ['+1-555-555-5555'], legal_names: ['Test User'] }); console.log('User created:', user.id); } catch (error) { console.error('Error creating user:', error); } } createUser();
Debug
Known issues
breakingv2.0.0 is a major version rewrite with TypeScript; although claimed backward compatible, review migration guide for potential signature changes.
fix
Test extensively in sandbox before upgrading from v1.x.
affects: >=2.0.0
gotchaThe default export Synapse is different from the named export Client; CJS require returns an object with Client property.
fix
Use const { Client } = require('synapsenode') or import { Client } from 'synapsenode'.
affects: >=2.0.0
gotchaEnvironment variables CLIENT_ID, CLIENT_SECRET, FINGERPRINT are mandatory; missing them will cause runtime errors.
fix
Create .env file with required variables or pass them directly to client constructor.
affects: all
gotchaSetting isProduction to true uses production endpoint; ensure you have production credentials and intend real API calls.
fix
Default to false (sandbox) for development.
affects: all
Errors
Common errors & fixes
TypeError: Synapse.Client is not a constructor
Using default import with CJS require incorrectly.
fix
Use const { Client } = require('synapsenode') or import { Client } from 'synapsenode'.
Error: CLIENT_ID is not defined
Missing environment variables or .env file not loaded.
fix
Call require('dotenv').config() and ensure .env file exists.
Error: 401 Unauthorized
Invalid or expired client_id/client_secret/fingerprint.
fix
Regenerate credentials from SynapseFI dashboard.
Upgrade
Version history
2.0.0-beta.11latest on npm
Audit
Dependencies
dotenvoptionalUsed for loading environment variables (CLIENT_ID, CLIENT_SECRET, FINGERPRINT) from .env file as recommended in documentation.
Agent activity
50 hits · last 30 days
node
46
Resources
synapsenode — npm install synapsenode · libregistry