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

api-city-sdk

v0.1.0

Published

SDK for building plugins for API City

Downloads

3

Readme

Tapestry Plugin SDK

A powerful SDK for building plugins for the Tapestry Chat platform. Create interactive plugins that can integrate with Solana wallets, manage state, and provide rich user interfaces.

Features

  • 🔒 Secure wallet integration
  • 💾 Persistent storage
  • 🎨 React-based UI components
  • 📨 Message handling
  • 🔔 Notification system
  • ⚙️ Settings management

Installation

npm install @tapestry/plugin-sdk
# or
pnpm add @tapestry/plugin-sdk

Quick Start

  1. Create a new plugin by extending the BasePlugin class:
import { BasePlugin, PluginManifest } from '@tapestry/plugin-sdk';

const manifest: PluginManifest = {
  name: 'My Plugin',
  version: '1.0.0',
  description: 'A simple plugin',
  author: 'Your Name',
  permissions: ['wallet:read', 'ui:render'],
  entryPoints: {
    main: 'index.ts'
  }
};

export class MyPlugin extends BasePlugin {
  constructor() {
    super(manifest);
  }

  protected async onInitialize(): Promise<void> {
    // Initialize your plugin
    this.showNotification('Plugin initialized!');
  }

  protected async onCleanup(): Promise<void> {
    // Cleanup when plugin is disabled
  }
}
  1. Use the provided APIs:
// Wallet operations
const address = await this.wallet.getAddress();
const signature = await this.wallet.signMessage('Hello');

// Storage operations
await this.storage.set('myKey', { value: 123 });
const data = await this.storage.get('myKey');

// UI rendering
this.ui.render(
  <div className="p-4">
    <h1>My Plugin UI</h1>
    <button onClick={() => this.showNotification('Clicked!')}>
      Click me
    </button>
  </div>
);

// Notifications
this.showNotification('Operation successful!', 'success');

Plugin Manifest

The manifest defines your plugin's metadata and required permissions:

interface PluginManifest {
  name: string;
  version: string;
  description: string;
  author: string;
  permissions: PluginPermission[];
  entryPoints: {
    main: string;
    settings?: string;
    styles?: string;
  };
}

Available permissions:

  • wallet:read - Read wallet address and public data
  • wallet:write - Sign messages and send transactions
  • storage:read - Read from plugin storage
  • storage:write - Write to plugin storage
  • ui:render - Render UI components
  • notifications:create - Show notifications

Best Practices

  1. Error Handling
try {
  await this.wallet.sendTransaction(tx);
  this.showNotification('Success!', 'success');
} catch (error) {
  this.showNotification(error.message, 'error');
}
  1. State Management
// Save state on changes
private async saveState(): Promise<void> {
  await this.storage.set('pluginState', this.state);
}

// Load state on initialization
protected async onInitialize(): Promise<void> {
  this.state = await this.storage.get('pluginState') || defaultState;
}
  1. UI Updates
// Update UI when state changes
private updateUI(): void {
  this.ui.update(
    <MyComponent 
      data={this.state}
      onAction={this.handleAction}
    />
  );
}

Examples

Check out our example plugins:

Development

  1. Clone the repository
  2. Install dependencies:
pnpm install
  1. Build the SDK:
pnpm build
  1. Run tests:
pnpm test

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License - see LICENSE for details