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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@lead82/ticketing-sdk

v1.0.5

Published

SDK for reporting bugs and suggesting features

Downloads

5

Readme

Ticketing SDK

The Ticketing SDK allows you to easily integrate bug reporting and feature request functionality into your applications. With this SDK, your users can submit issues directly to your bug tracking system.

Installation

Install the SDK using:

npm install @lead82/ticketing-sdk
pnpm install @lead82/ticketing-sdk
yarn add @lead82/ticketing-sdk
bun add @lead82/ticketing-sdk

Quick Start

  1. Import and initialize the SDK:
import TicketingSDK from '@lead82/ticketing-sdk';

const ticketer = new TicketingSDK('YOUR_CLIENT_ID', 'YOUR_API_KEY', 'YOUR_PROJECT_KEY');
  1. Use the createTicket method to submit a bug report or feature request:
ticketer.createTicket({
  title: 'Button not working',
  description: 'The submit button on the contact form is not responding when clicked.',
  type: 'bug',
  priority: 'medium',
  userEmail: '[email protected]',
  url: 'https://api.example.com/database'
})
.then(response => console.log('Ticket created:', response))
.catch(error => console.error('Error creating ticket:', error));

API Reference

createTicket(data)

Reports an issue to the bug tracking system.

Parameters

  • data (Object):
    • title (string, required): A brief description of the issue
    • description (string): Detailed information about the issue
    • type (string): Either 'bug' or 'feature'
    • priority (string): 'low', 'medium', 'high', or 'critical'
    • userEmail (string): Email of the user reporting the issue
    • url (string): URL where the issue occurred

Returns

A Promise that resolves with the created ticket information.

Usage Examples

React Component

import React, { useState } from 'react';
import { useSession } from 'next-auth/react';
import TicketingSDK from '@lead82/ticketing-sdk';

const ticketer = new TicketingSDK('YOUR_CLIENT_ID', 'YOUR_API_KEY', 'YOUR_PROJECT_KEY');

function ReportBugForm() {
  const session = useSession()
  const [title, setTitle] = useState('')
  const [description, setDescription] = useState('')
  const handleSubmit = async (e) => {
    e.preventDefault()
    try {
      const response = await ticketer.createTicket({
        title, //'Bug in checkout process'
        description, //'Payment fails when using Visa card'
        type: 'bug', // You could add a "bug or feature" dropdown to your form and make it more general
        priority: 'medium', // either set a default to "low" or "medium" or use NLP to determine priority level
        userEmail: session.user.email,
        url: window.location.href
      });
      console.log(response)
    } catch (error) {
      console.error('Failed to report bug:', error);
    }
  };

  return (
        <form onSubmit={handleSubmit}>
            <input name="title" placeholder="Issue title" onChange={e => setTitle(e.target.value)} />
            <input name="description" placeholder="Issue description"  onChange={e => setTitle(e.target.value)} />
            <button type="submit">Report a Bug</button>
        </form>
    );
}

Configuration

To use this SDK, you need to obtain an API key and a project key from your dashboard. Visit [https://ticketing.lead82.io/documentation] to generate these keys.

Browser Support

This SDK is compatible with modern browsers and can be used in projects built with frameworks like React, Vue, and Angular.

Node.js Support

The SDK can also be used in Node.js environments for server-side applications.

TypeScript Support

This package includes TypeScript declarations.

Contributing

We welcome contributions to the Bug Reporter SDK! Please see our CONTRIBUTING.md for details on how to submit pull requests, report issues, and suggest improvements.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Support

If you encounter any issues or have questions about using the Bug Reporter SDK, please contact our support team at [email protected] or visit our support page.

Changelog

See CHANGELOG.md for details on each release.

Security

Please report any security issues to [email protected].