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

svelte-surefeedback

v0.0.1

Published

A lightweight Svelte wrapper component for SureFeedback/ProjectHuddle integration

Readme

Svelte SureFeedback

A Svelte wrapper component for SureFeedback (ProjectHuddle) that provides seamless integration with your Svelte applications.

Installation

npm install svelte-surefeedback

Features

  • 🚀 Easy integration with Svelte applications
  • 🔒 Type-safe with full TypeScript support
  • 🎯 Automatic script loading and cleanup
  • 🔄 Token persistence management
  • 🐛 Debug mode for troubleshooting
  • ⏱️ Configurable timeout handling
  • 🎭 Event callbacks for load and error states

Usage

Basic usage:

<script>
  import { SureFeedback } from 'svelte-surefeedback';
</script>

<SureFeedback 
  url="//feedback.mindhyv.com/?p=YOUR_PROJECT_ID&ph_apikey=YOUR_API_KEY" 
/>

Advanced usage with all options:

<script>
  import { SureFeedback } from 'svelte-surefeedback';

  function handleError(error) {
    console.error('SureFeedback error:', error);
  }

  function handleLoaded() {
    console.log('SureFeedback loaded successfully');
  }
</script>

<SureFeedback 
  url="//feedback.mindhyv.com/?p=YOUR_PROJECT_ID&ph_apikey=YOUR_API_KEY"
  enabled={true}
  debug={true}
  timeout={15000}
  persistToken={true}
  tokenKey="ph_access_token"
  onError={handleError}
  onLoaded={handleLoaded}
/>

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | url | string | Required | The SureFeedback URL with your project ID and API key | | enabled | boolean | true | Enable/disable the feedback widget | | debug | boolean | false | Enable debug mode for detailed logging | | timeout | number | 10000 | Script loading timeout in milliseconds | | persistToken | boolean | true | Whether to persist the access token in localStorage | | tokenKey | string | 'ph_access_token' | Custom key for storing the token | | onError | (error: string) => void | undefined | Callback function for error handling | | onLoaded | () => void | undefined | Callback function when script loads successfully |

Error Handling

The component includes built-in error handling for:

  • Invalid URLs
  • Missing required parameters
  • Script loading failures
  • Timeout issues
  • LocalStorage access problems

Errors are displayed in a clear message and can be caught using the onError callback.

Debug Mode

When debug mode is enabled, the component will log detailed information about:

  • Script loading process
  • Token management
  • Error states
  • Cleanup operations

Enable debug mode during development:

<SureFeedback 
  url="your-url"
  debug={true}
/>

TypeScript Support

The package includes full TypeScript definitions. You can import types:

import type { SureFeedbackProps } from 'svelte-surefeedback';

Requirements

  • Svelte 5.x
  • SureFeedback/ProjectHuddle account and API credentials

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.