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

@ewjdev/anyclick-t3chat

v3.0.0

Published

T3.chat adapter for Anyclick - send text and queries to t3.chat

Readme

@ewjdev/anyclick-t3chat

T3.chat adapter for Anyclick - send selected text and queries to t3.chat for AI-powered answers.

Installation

npm install @ewjdev/anyclick-t3chat
# or
yarn add @ewjdev/anyclick-t3chat
# or
pnpm add @ewjdev/anyclick-t3chat

Quick Start

With Anyclick React

The easiest way to use t3.chat integration is with the Chrome preset or the createT3ChatMenuItem helper:

import { AnyclickProvider, createPresetMenu } from "@ewjdev/anyclick-react";

// Option 1: Use Chrome preset (includes t3.chat by default)
const chromePreset = createPresetMenu("chrome");

// Option 2: Add to custom menu
import { createT3ChatMenuItem } from "@ewjdev/anyclick-react";

const menuItems = [
  { label: "Report Bug", type: "bug", showComment: true },
  createT3ChatMenuItem(), // Adds "Ask t3.chat" item
];

function App() {
  return (
    <AnyclickProvider menuItems={menuItems}>
      <YourApp />
    </AnyclickProvider>
  );
}

Standalone Usage

Use the adapter directly for custom integrations:

import {
  createT3ChatAdapter,
  getSelectedText,
  hasTextSelection,
} from "@ewjdev/anyclick-t3chat";

// Create adapter
const adapter = createT3ChatAdapter({
  baseUrl: "https://t3.chat",
  openInNewTab: true,
});

// Send a query
adapter.sendQuery("How do I fix this TypeScript error?");

// Send selected text
if (hasTextSelection()) {
  adapter.sendSelectedText();
}

// Get selected text
const text = getSelectedText();
console.log("Selected:", text);

API

T3ChatAdapter

The main adapter class for t3.chat integration.

Constructor Options

interface T3ChatAdapterOptions {
  /** Base URL for t3.chat (default: "https://t3.chat") */
  baseUrl?: string;
  /** Whether to open in a new tab (default: true) */
  openInNewTab?: boolean;
  /** Custom URL builder function */
  buildUrl?: (query: string) => string;
}

Methods

  • sendQuery(query: string): T3ChatResult - Send a query to t3.chat
  • sendSelectedText(): T3ChatResult - Send currently selected text
  • openT3Chat(): T3ChatResult - Open t3.chat without a query
  • hasSelection(): boolean - Check if text is selected
  • getSelectedText(): string - Get the selected text
  • getBaseUrl(): string - Get the configured base URL

Utility Functions

import {
  getSelectedText,
  hasTextSelection,
  getTextSelectionContext,
  buildT3ChatUrl,
  navigateToUrl,
} from "@ewjdev/anyclick-t3chat";

// Get selected text
const text = getSelectedText();

// Check if text is selected
if (hasTextSelection()) {
  // ...
}

// Get detailed selection context
const context = getTextSelectionContext();
// { text: "...", hasSelection: true, anchorElement: Element }

// Build a t3.chat URL
const url = buildT3ChatUrl("my query", "https://t3.chat");
// "https://t3.chat/?q=my%20query"

// Navigate to a URL
navigateToUrl(url, true); // true = new tab

Quick Chat Integration

When using Anyclick's Quick Chat feature, t3.chat integration is enabled by default:

<AnyclickProvider
  quickChatConfig={{
    endpoint: "/api/anyclick/chat",
    t3chat: {
      enabled: true, // Show "Send to t3.chat" button
      baseUrl: "https://t3.chat",
      label: "Ask t3.chat",
    },
  }}
>
  <YourApp />
</AnyclickProvider>

Users can type a question and click the t3.chat button to open it in a new tab with their query pre-filled.

Browser Extension

The t3.chat adapter also works with the Anyclick browser extension. See @ewjdev/anyclick-extension for details.

TypeScript

Full TypeScript support with exported types:

import type {
  T3ChatAdapterOptions,
  T3ChatResult,
  TextSelectionContext,
} from "@ewjdev/anyclick-t3chat";

License

MIT