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

@elasticpath/plasmic-backend-sdk

v0.0.6

Published

TypeScript SDK for Plasmic Admin API

Readme

@elasticpath/plasmic-backend-sdk

TypeScript SDK for Plasmic Admin API with automatic authentication handling.

Features

  • Type-safe API client generated from OpenAPI specification
  • Automatic CSRF token management
  • Session-based cookie authentication
  • Support for all Plasmic project, workspace, and admin operations

Installation

pnpm add @elasticpath/plasmic-backend-sdk

Quick Start

import { createPlasmicClient, listProjects, createProject } from '@elasticpath/plasmic-backend-sdk';

// Create an authenticated client
const plasmic = createPlasmicClient('https://studio.plasmic.app');

// Authenticate
await plasmic.authenticate('[email protected]', 'password');

// List all projects
const { data } = await listProjects({
  client: plasmic.client,
  query: { query: 'all' },
});

console.log(data?.projects);

Authentication

The SDK handles session-based authentication with CSRF token management:

const plasmic = createPlasmicClient({
  baseUrl: 'https://studio.plasmic.app',
  throwOnError: true, // default: true
});

// Login with email/password
await plasmic.authenticate('[email protected]', 'password');

// Check if authenticated
console.log(plasmic.isAuthenticated); // true

// Sign out
await plasmic.signOut();

Session Validation

// Check if an existing session is still valid
const isValid = await plasmic.checkSession();
if (!isValid) {
  await plasmic.authenticate('[email protected]', 'password');
}

API Reference

Projects

import {
  listProjects,
  getProject,
  createProject,
  updateProject,
  deleteProject,
  cloneProject,
} from '@elasticpath/plasmic-backend-sdk';

// List all projects
const { data } = await listProjects({
  client: plasmic.client,
  query: { query: 'all' },
});

// Get a specific project
const { data: project } = await getProject({
  client: plasmic.client,
  path: { projectId: 'project-id' },
});

// Create a new project
const { data: newProject } = await createProject({
  client: plasmic.client,
  body: {
    name: 'My New Project',
    workspaceId: 'workspace-id',
  },
});

// Update a project
await updateProject({
  client: plasmic.client,
  path: { projectId: 'project-id' },
  body: { name: 'Updated Name' },
});

// Delete a project
await deleteProject({
  client: plasmic.client,
  path: { projectId: 'project-id' },
});

// Clone a project
const { data: cloned } = await cloneProject({
  client: plasmic.client,
  path: { projectId: 'project-id' },
  body: {
    name: 'Copy of Project',
    workspaceId: 'target-workspace-id',
  },
});

Workspaces

import {
  listWorkspaces,
  getWorkspace,
  createWorkspace,
  updateWorkspace,
  deleteWorkspace,
} from '@elasticpath/plasmic-backend-sdk';

// List all workspaces
const { data } = await listWorkspaces({ client: plasmic.client });

// Get a specific workspace
const { data: workspace } = await getWorkspace({
  client: plasmic.client,
  path: { workspaceId: 'workspace-id' },
});

// Create a new workspace
const { data: newWorkspace } = await createWorkspace({
  client: plasmic.client,
  body: {
    name: 'My Workspace',
    teamId: 'team-id',
  },
});

Admin Operations

Admin operations require the user to be listed in the server's admin email configuration.

import {
  adminListProjects,
  adminCloneProject,
  adminDeleteProject,
  adminRestoreProject,
  adminChangeProjectOwner,
  adminRevertRevision,
} from '@elasticpath/plasmic-backend-sdk';

// List all projects (admin)
const { data } = await adminListProjects({
  client: plasmic.client,
  body: { ownerId: 'user-id' }, // optional filter
});

// Clone any project (admin)
const { data: cloned } = await adminCloneProject({
  client: plasmic.client,
  body: {
    projectId: 'project-id',
    revisionNum: 5, // optional: clone from specific revision
  },
});

// Restore a deleted project
await adminRestoreProject({
  client: plasmic.client,
  body: { id: 'project-id' },
});

// Change project owner
await adminChangeProjectOwner({
  client: plasmic.client,
  body: {
    projectId: 'project-id',
    ownerEmail: '[email protected]',
  },
});

// Revert to a previous revision
await adminRevertRevision({
  client: plasmic.client,
  body: {
    projectId: 'project-id',
    revision: 10,
  },
});

Development

Setup

# Install dependencies
pnpm install

# Generate SDK from OpenAPI spec
pnpm generate

# Build the package
pnpm build

# Run tests
pnpm test

# Lint code
pnpm lint

# Format code
pnpm format

Regenerating the SDK

If the OpenAPI specification changes, regenerate the SDK:

pnpm generate

This uses heyapi to generate type-safe API functions from the OpenAPI spec.

License

MIT