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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@vista.io/vista-api-client

v0.8.0

Published

NodeJS implementation of the Vista API.

Downloads

96

Readme

Vista API for NodeJS

NodeJS client for the Vista API.

Reference

Prerequisites

You'll need to create a Vista API key from the Vista Dashboard.

Usage

Install the package:

npm install @vista.io/vista-api-client;

Then in your Node application:

import VistaClient from '@vista.io/vista-api-client';

const VISTA_API_KEY = 'create-in-vista-dashboard';
const client = new VistaClient(VISTA_API_KEY, 'branch_name');
const roles = client.roles.list()

After that you are good to go!

Please see the Vista API Documentation for the API documentation.

All Operator

You can use VistaClient.ALL in place where resource_id or resource_type is accepted to indicate all.

Changing Branches for Operation

Although branch is required as a part of the constructor, one may use client.withBranch(branch: string) to use supply a different branch using the same client.

Usage

The following describes methods namespaced by Vista resources.

Admin

client.admin

| method | description | |--------|-------------| | createBranch(branch: string)| Creates a set of read-only tokens meant to be used by Vista React components | | cloneBranch(branch: string, newBranch: string)| Clones templates in branch to newBranch | | createReadTokens()| Creates a set of read-only tokens meant to be used by Vista React components | | getCompany()| Gets Company ID |

Resource Types

client.resourceTypes

| method | description | |--------|-------------| | list() | Lists all Resource Types | | upsert(name: string, actions: string[], attributes: {id: string, target_resource_type: string, attribute_type: 'RELATIONSHIP' \| 'SCALAR'}[]) | Upserts a Resource Type | | addRelationship(fromId: string, fromResourceType: string, attribute: string, toId: string, toResourceType: string)| Adds an attribute relationship between 2 resourceIds |

Roles

client.roles

| method | description | |--------|-------------| | client.roles.list(orgId?: string) | Lists all Roles | | client.roles.upsert(roleId: string, permissions: { resourceType: string, attribute: string, action: string, ownerId: string }[] owners: { key: { query: string, dbId: string } }, arentRoles: string[], orgId: string) | Upserts a Role |

Users

client.users

| method | description | |--------|-------------| | create(userId: string, orgId: string) | Creates new User | | list(orgId?: string)| Lists Users in orgId | | listOrgs()| Lists all orgs for set branch | | assignToUserset(userId: string, usersetId: string) | Adds User to a Userset | | removeFromUserset(userId: string, usersetId: string) | Removes User from Userset | | check(userId: string, action: string, resourceType: string, resourceId: string, attribute?: string) | Checks User access | | expand(userId: string) | Returns all permissions for users (action, resource_type, resource_id) | | grantAction(userId: string, action: string, resourceType: string, resourceId: string, attribute?: string?) | Allows User to perform action on (resourceId, resourceType) | | revokeAction(userId: string, action: string, resourceType: string, resourceId: string, attribute?: string?) | Revokes action on (resourceId, resourceType) for User | | grantRole(userId: string, roleId: string, resourceType: string, resourceId: string) | Grants Role to User | | revokeRole(userId: string, roleId: string, resourceType: string, resourceId: string) | Revokes Role from User |

Usersets

client.usersets

| method | description | |--------|-------------| | create(userId: string, orgId: string) | Creates Userset | | inherit(childRoleId: string, parentRoleId: string) | Adds Userset as child of parent Userset | | grantAction(userId: string, action: string, resourceType: string, resourceId: string, attribute?: string) | Allows User to perform action on (resourceId, resourceType) | | revokeAction(userId: string, action: string, resourceType: string, resourceId: string, attribute?: string) | Revokes action on (resourceId, resourceType) for Userset | | grantRole(userId: string, roleId: string, resourceType: string, resourceId: string) | Grants Role to Userset | | revokeRole(userId: string, roleId: string, resourceType: string, resourceId: string) | Revokes Role from Userset |

Grants

client.grants

| method | description | |--------|-------------| | list(userId: string \| null, action: string \| null, resourceId: string \| null, resourceType: string \| null, attribute: string \| null, orgId: string \| null, startTime: string \| null, endTime: string \| null)| List & filter grants by arguments, startTime is inclusive (>=) and endTime is exclusive (<) | | listUnflattened(usersetId: string \| None, relation: string \| None, relationType: string \| None, resourceId: string \| None, resourceType: string \| None, attribute: string \| None, orgId: string \| None)| Filters User or Userset grants |

Blueprint

client.blueprint

| method | description | |--------|-------------| | upsert(fpath: string)| Upserts branches, resource types, and roles defined in blueprint file (yaml or json). fpath is the relative path to the vista config file.|