npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

view-sdk

v1.0.4

Published

View SDK for JavaScript

Readme

JavaScript SDK for View AI

View AI enables organizations to rapidly deploy conversational AI experiences and yield instant insights. This SDK provides a simplified interface for consuming View AI configuration services in JavaScript applications.

License

View software is licensed under the Fair Core License (FCL) with graduation after two years to an Apache 2.0 license. Use of the software requires acceptance of the license terms found in the file LICENSE.md.

Requirements

  • Node.js v18.20.4
  • npm

Dependencies

Use the command npm i to install dependencies.

Installation

Install the SDK using npm:

npm install view-sdk

Getting Started

Following below is the example of JS code utilizing the sdk:

Basic Configuration

import { ViewConfigurationSdk } from 'view-sdk';

const api = new ViewConfigurationSdk(
  'http://view.homedns.org:8000', //endpoint
  '<tenantId>', //tenant Id
  '******' //access token
);

Available Services

The SDK provides access to the following services:

  • Assistant: AI assistant management and interactions
  • Configuration: System configuration and settings management
    • Blobs, Credentials, Data Repositories
    • Encryption Keys, Graph Repositories
    • Nodes, Tenants, Users
    • Vector Repositories, Webhooks
  • Lexi: Natural language processing capabilities
  • Processor: Data processing and transformation
  • Semantic: Semantic analysis and processing
  • Storage: Data storage operations
  • Vector: Vector operations and similarity search
  • IngestQueue: Manage ingest queue operations
  • Embeddings: Embedding operations
  • Healthcheck: Healthcheck operations
  • Crawler: Crawler operations
  • Director: Director operations

Example Usage

// region Nodes
const getNode = async () => {
  try {
    const nodes = await api.Nodes.read('<nodeId>');
    console.log(nodes, 'Nodes fetched successfully');
  } catch (err) {
    console.log('Error fetching Nodes:', err);
  }
};
getNode();

Example Usage with Tenant

const createTenant = async () => {
  try {
    const createdTenant = await api.Tenant.create({
      Name: 'My tenant',
      Region: 'us-west-1',
      S3BaseDomain: 'localhost',
      RestBaseDomain: 'localhost',
      DefaultPoolGUID: '00000000-0000-0000-0000-000000000000',
    });
    console.log(createdTenant, 'Tenant created successfully');
  } catch (err) {
    console.log('Error creating Tenant:', err);
  }
};

createTenant();

Example Usage with Credentials

// region Credentials
export const createCredential = async () => {
  try {
    const response = await api.Credential.create({
      UserGUID: '<userId>',
      Name: 'Default credential',
      Active: true,
    });
    console.log(response, 'Credential created successfully');
  } catch (err) {
    console.log('Error creating Credential:', err);
  }
};
createCredential();
// region Credentials
export const getAllCredentials = async () => {
  try {
    const credentials = await api.Credential.readAll();
    console.log(credentials, 'All credentials fetched successfully');
  } catch (err) {
    console.log('Error fetching Credentials:', err);
  }
};

getAllCredentials();

Example Usage with User

export const createUser = async () => {
  try {
    const user = await api.User.create({
      FirstName: 'John',
      LastName: 'Doe',
      Notes: 'Default password is password',
      Email: '[email protected]',
      PasswordSha256: '******',
    });
    console.log(user, 'User created successfully');
  } catch (err) {
    console.log('Error creating User:', err);
  }
};
createUser();

Example Usage with Vector Repository

// region Vector Repositories
const createVectorRepository = async () => {
  try {
    const response = await api.VectorRepository.create({
      Name: 'My vector repository ash 3',
      RepositoryType: 'Pgvector' as any,
      Model: 'all-MiniLM-L6-v2',
      Dimensionality: 384,
      DatabaseHostname: 'localhost',
      DatabaseName: 'vectordb',
      SchemaName: 'public',
      DatabaseTable: 'minilm',
      DatabasePort: 5432,
      DatabaseUser: 'postgres',
      DatabasePassword: 'password',
    });
    console.log(response, 'Vector repository created successfully');
  } catch (err) {
    console.log('Error creating Vector repository:', err);
  }
};

createVectorRepository();

Example Usage with Graph Repository

// region Graph Repositories
const createGraphRepository = async () => {
  try {
    const response = await api.GraphRepository.create({
      Name: 'My LiteGraph instance ash 3',
      RepositoryType: 'LiteGraph',
      EndpointUrl: 'http://localhost:8701/',
      ApiKey: 'default',
      GraphIdentifier: '00000000-0000-0000-0000-000000000000',
    });
    console.log(response, 'Graph repository created successfully');
  } catch (err) {
    console.log('Error creating Graph repository:', err);
  }
};

createGraphRepository();
const graphRepositoryExists = async () => {
  try {
    const response = await api.GraphRepository.exists('<graphRepositoryId>');
    console.log(response, 'Graph repository exists');
  } catch (err) {
    console.log('Error checking Graph repository:', err);
  }
};

graphRepositoryExists();
const readGraphRepository = async () => {
  try {
    const response = await api.GraphRepository.read('<graphRepositoryId>');
    console.log(response, 'Graph repository fetched successfully');
  } catch (err) {
    console.log('Error fetching Graph repository:', err);
  }
};

readGraphRepository();
const getAllGraphRepositories = async () => {
  try {
    const data = await api.GraphRepository.readAll();
    console.log(data, 'All graph repositories fetched successfully');
  } catch (err) {
    console.log('Error fetching Graph repositories:', err);
  }
};

getAllGraphRepositories();

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Support

For support, please:

  1. Check the documentation
  2. Open an issue on GitHub
  3. Contact View AI support

Development

Setting up Pre-commit Hooks

The pre-commit hooks will run automatically on git commit. They help maintain:

  • Code formatting (using ruff)
  • Import sorting
  • Code quality checks
  • And other project-specific checks

Running Tests

The project uses jest for running tests in isolated environments. Make sure you have jest installed, which should automatically be there if you have installed dependencies via npm i command:

# Run only the tests
npm run test

# Run tests with coverage report
npm run test:coverage

# Build the package
npm run build

Development Installation

Linking view-sdk dependency locally

To use the library locally without publishing to a remote npm registry, first install the dependencies with the command:

npm install

Next, link it globally in local system's npm with the following command:

npm link

To use the link you just defined in your project, switch to the directory you want to use your view-sdk from, and run:

npm link view-sdk

Finally, you need to build the sdk, use command:

npm run build

You can then import the SDK with either import or require based on the ES Module (esm) or CommonJS (cjs) project, as shown below:

import sdk from 'view-sdk';
//or
var sdk = require('view-sdk');

Feedback and Issues

Have feedback or found an issue? Please file an issue in our GitHub repository.

Documentation

For detailed API documentation and examples, visit View Documentation.

Version History

Please refer to CHANGELOG.md for a detailed version history.