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

@meaple-com/react-query

v1.1.1

Published

React Query hooks for Meaple SDK

Readme

@meaple-com/react-query

React Query (TanStack Query) hooks for the Meaple ticketing platform. Fetch and mutate Meaple data in React with caching, loading and error states.

Installation

npm install @meaple-com/react-query @meaple-com/core @meaple-com/types
# or
pnpm add @meaple-com/react-query @meaple-com/core @meaple-com/types
# or
bun add @meaple-com/react-query @meaple-com/core @meaple-com/types

Peer dependencies:

  • react ^19.0.0
  • @tanstack/react-query ^5.90.7
  • axios ^1.12.2
  • date-fns ^4.0.0

Install them if not already in your project.

Setup

Wrap your app with QueryClientProvider (from TanStack Query) and MeapleSDKProvider:

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { MeapleSDKProvider } from '@meaple-com/react-query';
import { MeapleSDK } from '@meaple-com/core';

const queryClient = new QueryClient();
const sdk = new MeapleSDK({
  publicKey: 'YOUR_CHANNEL_ID',
  baseURL: 'https://api.meaple.com',
});

function App() {
  return (
    <QueryClientProvider client={queryClient}>
      <MeapleSDKProvider sdk={sdk}>
        {/* Your app */}
      </MeapleSDKProvider>
    </QueryClientProvider>
  );
}

Optional: set the user token when they log in:

sdk.setGlobalToken('user-jwt-token');

Hooks

All hooks use the SDK from MeapleSDKProvider and return standard TanStack Query results (data, isPending, error, refetch, etc.). You can pass the same options as useQuery / useMutation (e.g. enabled, staleTime).

Events

  • useEvents(params?, options?) – List events
  • useEvent(eventId, slug, options?) – Single event
  • useEventTickets(eventId, slug, options?) – Event tickets
  • useEventProducts(eventId, slug, options?) – Event products

Categories

  • useCategories(options?) – List categories

Coupon

  • useCheckCoupon() – Mutation to validate a coupon (code + eventId)

Orders

  • useOrder(orderId, options?) – Single order
  • useUserOrders(params?, options?) – Current user orders
  • useCreateOrder() – Mutation to create an order

Payments

  • usePlatformFee(eventId, amount?, options?) – Platform fee for an amount

Tickets (user)

  • useUserEvents(params?, options?) – Current user events
  • useUserEventTickets(eventId, options?) – Current user tickets for an event
  • useTransferTicket() – Mutation to transfer a ticket
  • useEditUserTicket() – Mutation to edit user ticket
  • useCreateTicketFile() – Mutation to create ticket file
  • useRefundUserOrder() – Mutation to refund user order

Context

  • useMeapleSDK() – Access the Meaple SDK instance (throws if used outside MeapleSDKProvider)

Example

import { useEvents, useEvent } from '@meaple-com/react-query';

function EventList() {
  const { data, isPending, error } = useEvents({ limit: 20 });

  if (isPending) return <div>Loading...</div>;
  if (error) return <div>Error: {error.message}</div>;

  return (
    <ul>
      {data?.events.map((event) => (
        <li key={event.id}>{event.name}</li>
      ))}
    </ul>
  );
}

function EventDetail({ eventId, slug }: { eventId: string; slug: string }) {
  const { data: event } = useEvent(eventId, slug);
  // ...
}

With headless components

Use @meaple-com/react-headless-components for render-props components that call these hooks and expose data, isPending, error (and mutations where relevant), so you can focus on styling and layout.

Documentation

https://docs.meaple.com.br/