New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@visionfi/server-sdk

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@visionfi/server-sdk

Server-side SDK for VisionFI API access using Google Service Account authentication

latest
npmnpm
Version
1.4.0
Version published
Maintainers
1
Created
Source

@visionfi/server

Server-side SDK for VisionFI API access using Google Service Account authentication.

Installation

npm install @visionfi/server

Quick Start

import { VisionFi } from '@visionfi/server';

// Initialize with service account
const client = new VisionFi({
  serviceAccountPath: './service-account.json'
});

// Or use Application Default Credentials
const client = new VisionFi();

// Verify authentication
const auth = await client.verifyAuth();

// Create a package
const pkg = await client.createPackage({
  productType: 'consumer_loan_vehicle',
  description: 'Vehicle loan application'
});

// Analyze a document
const job = await client.analyzeDocument(fileBuffer, {
  fileName: 'document.pdf',
  analysisType: 'auto_loan_abstract'
});

// Get results
const results = await client.getResults(job.uuid);

Authentication

This package supports three authentication methods:

  • Service Account File: Provide path to JSON key file
  • Service Account JSON: Pass JSON object directly
  • Application Default Credentials: Automatic in GCP environments

Features

  • Document analysis and processing
  • Package management
  • Package sharing with role-based permissions
  • DocuSign integration
  • Workflow management
  • Processing history and results
  • Per-request custom headers for B2B2C scenarios

Package Sharing

The SDK supports sharing packages with other users with role-based permissions.

Share a Package

// Share with specific users
await client.packages.sharing.addShares('package-uuid', [
  { target: 'user@example.com', role: 'editor' },
  { target: 'viewer@example.com', role: 'viewer' }
]);

// Share with all users in your organization
await client.packages.sharing.addShares('package-uuid', [
  { target: 'AllUsers', role: 'viewer' }
]);

Update Share Role

await client.packages.sharing.updateRole('package-uuid', 'user@example.com', 'viewer');

Remove a Share

await client.packages.sharing.remove('package-uuid', 'user@example.com');

Get Sharing Info (Owner Only)

const info = await client.packages.sharing.getInfo('package-uuid');
// { packageId, owner, shares: [{ target, role }] }

List Packages Shared With Me

const shared = await client.packages.listShared();
// { packages: [{ packageId, owner, myRole, sharedVia, ... }], total }

List All Accessible Packages

// List only owned packages (default)
const owned = await client.packages.list();

// List only shared packages
const shared = await client.packages.list({ include: 'shared' });

// List all accessible packages (owned + shared)
const all = await client.packages.list({ include: 'all' });

Per-Request Custom Headers

All SDK methods support an optional requestOptions parameter that allows you to pass custom headers on a per-request basis. This is useful for B2B2C scenarios where you need to identify the end-user making the request.

Example: Passing End-User Identity

import { VisionFi } from '@visionfi/server';

const client = new VisionFi();

// Pass end-user identity via VF-On-Behalf-Of header
const packages = await client.packages.list(
  { productTypes: 'consumer_loan_vehicle' },
  { headers: { 'VF-On-Behalf-Of': 'user@example.com' } }
);

// Works with all SDK methods
const pkg = await client.packages.get(
  'package-uuid',
  { headers: { 'VF-On-Behalf-Of': 'user@example.com' } }
);

// Create package on behalf of user
const newPkg = await client.packages.create(
  { productType: 'consumer_loan_vehicle' },
  { headers: { 'VF-On-Behalf-Of': 'user@example.com' } }
);

// Execute processing on behalf of user
const result = await client.packages.processing.execute(
  'package-uuid',
  { workflow: 'auto_loan_abstract' },
  { headers: { 'VF-On-Behalf-Of': 'user@example.com' } }
);

Protected Headers

For security, the following headers cannot be overridden per-request and will be stripped:

  • authorization - Managed by SDK authentication
  • host - Managed by axios
  • x-api-key - Managed by SDK configuration

License

Copyright (c) 2024-2025 VisionFI. All Rights Reserved.

See LICENSE file for details.

Keywords

visionfi

FAQs

Package last updated on 24 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts