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

@mentoor/inline-guide

v0.4.0

Published

Browser SDK for Mentoor in-app product guidance, live UI navigation, and customer onboarding.

Downloads

568

Readme

Mentoor Inline Guide

Mentoor is a browser SDK for in-app product guidance. It adds a lightweight helper layer to your live product so users can ask for help, follow published guides, and get pointed to real controls without leaving the page.

Use it when you want product onboarding, feature discovery, release guidance, or contextual help inside the app your users already have open.

Install

npm install @mentoor/inline-guide

Or load the hosted script:

<script src="https://mentoor.ai/sdk.js"></script>

Quickstart

Create a project and public browser key in Mentoor Studio, add your app URL to the allowed origins, then initialize Mentoor from browser-side code:

import { Mentoor } from '@mentoor/inline-guide'

const mentoor = Mentoor.init({
  projectId: 'your-project-id',
  publicKey: 'pk_live_public_browser_key',
  apiBase: 'https://mentoor.ai',
  environment: 'production',
  chatEnabled: true,
  privacy: 'balanced',
  // Launcher pill / panel copy. Defaults to "Find anything".
  launcherLabel: 'Find anything',
  user: currentUser ? { id: currentUser.id } : undefined,
  traits: { plan: 'trial' },
  getRouteContext: () => ({
    route: window.location.pathname + window.location.hash,
    title: document.title,
    url: window.location.href,
  }),
})

For script-tag installs:

<script src="https://mentoor.ai/sdk.js"></script>
<script>
  window.Mentoor.init({
    projectId: 'your-project-id',
    publicKey: 'pk_live_public_browser_key',
    apiBase: 'https://mentoor.ai',
    environment: 'production',
    chatEnabled: true,
    privacy: 'balanced',
    getRouteContext: () => ({
      route: window.location.pathname + window.location.hash,
      title: document.title,
      url: window.location.href,
    }),
  })
</script>

Keep apiBase explicit. It should point to the Mentoor API host shown in Studio. That prevents app proxies, Next.js middleware, and same-path /api routes from accidentally receiving SDK calls.

Stable Anchors

Mentoor can learn from accessible labels, roles, layout, and route context, but important controls should have stable anchors:

<button data-mentoor="invite-teammate" data-mentoor-label="Invite teammate">
  Invite teammate
</button>

<input data-mentoor="teammate-email" aria-label="Teammate email" />

Use data-mentoor anywhere you want a durable product anchor.

Use data-mentoor-ignore around private or noisy regions that Mentoor should not inspect:

<section data-mentoor-ignore>
  Private billing details
</section>

Privacy Modes

privacy: 'essential' keeps explicit help useful without passive learning:

  • Published guides can still run.
  • Users can still ask questions from the current screen.
  • Browser storage, visitor memory, guide memory, passive product learning, and personalization stay off unless you enable them.

privacy: 'balanced' enables the full product loop:

  • Safe product-map learning from routes, labels, roles, anchors, and click/input events with values redacted.
  • Guide memory and anonymous visitor continuity across page loads.
  • Draft guide suggestions and personalization when your app passes user or trait data.

You can start in Essential mode and enable specific capabilities after your app has consent or another privacy basis:

const mentoor = Mentoor.init({
  projectId: 'your-project-id',
  publicKey: 'pk_live_public_browser_key',
  apiBase: 'https://mentoor.ai',
  privacy: 'essential',
})

mentoor.setConsent({
  storage: true,
  productLearning: true,
  visitorMemory: true,
  guideMemory: true,
  personalization: true,
})

Hard storage overrides are also available:

  • storage: 'local': persistent browser storage.
  • storage: 'memory': runtime-only storage.
  • storage: 'none': no local visitor or guide state.

Runtime API

Mentoor.init() returns a runtime object:

await mentoor.ask('Where do I invite a teammate?')
await mentoor.startGuide('invite teammate')
await mentoor.identify({
  id: 'your-user-id',
  traits: { role: 'admin', plan: 'growth' },
})
await mentoor.setTraits({ onboarding: 'started' })
mentoor.open()
mentoor.close()
mentoor.sync()
mentoor.destroy()

Experimental agent mode can perform bounded, human-paced UI actions when your app enables it:

const mentoor = Mentoor.init({
  projectId: 'your-project-id',
  publicKey: 'pk_live_public_browser_key',
  apiBase: 'https://mentoor.ai',
  agent: {
    enabled: true,
    allowClicks: true,
    allowTyping: true,
  },
})

await mentoor.act('Invite teammate [email protected]')

High-risk controls are blocked by default. If your app wants Mentoor to click one, mark that exact control:

<button
  data-mentoor="regenerate-api-key"
  data-mentoor-label="Regenerate API key"
  data-mentoor-agent="allow"
>
  Regenerate API key
</button>

Your app still owns auth, permissions, validation, and destructive action checks.

Manual Guides

Most teams publish guides from Studio, but the SDK also exposes guide primitives:

import { createMentoorGuide } from '@mentoor/inline-guide'

const guide = createMentoorGuide({
  name: 'Mentoor',
  intro: {
    title: 'Want a quick live guide?',
    message: 'I can walk you through the invite flow while you use the product.',
  },
  steps: [
    {
      id: 'invite',
      target: '[data-mentoor="invite-teammate"]',
      action: 'click',
      message: 'Start here.',
      successMessage: 'Nice. I will follow you.',
    },
    {
      id: 'email',
      target: '[data-mentoor="teammate-email"]',
      action: 'input',
      message: 'Type their email here. I will wait.',
      minChars: 3,
    },
  ],
})

guide.start()

Destroy a guide when the host route unmounts:

guide.destroy()

Semantic Targets

Mentoor stores product intent and target evidence instead of relying only on brittle selectors.

import {
  createMentoorRecorder,
  createMentoorTargetFingerprint,
  resolveMentoorTarget,
  scoreMentoorTargetCandidate,
} from '@mentoor/inline-guide'

const recorder = createMentoorRecorder({
  redactInputValues: true,
  onAction(action) {
    console.log(action.intent, action.fingerprint)
  },
})

recorder.start()

const fingerprint = createMentoorTargetFingerprint(inviteButton)
const match = resolveMentoorTarget(fingerprint)

if (match && match.score >= 80) {
  console.log('Use this target', match.element, match.reasons)
}

const scored = scoreMentoorTargetCandidate(fingerprint, candidateElement)

Fingerprints can include:

  • data-mentoor or data-testid anchors.
  • Accessible names.
  • Roles and tags.
  • Semantic region and landmark paths.
  • Link hrefs.
  • Nearby labels, legends, and headings.
  • Duplicate-label ordinals.
  • Routes.
  • Input types.
  • Visible text.

Framework Notes

Initialize Mentoor only in browser-side code after window exists.

React:

import { useEffect } from 'react'
import { Mentoor, type MentoorAssistant } from '@mentoor/inline-guide'

export function MentoorProvider({ userId }: { userId?: string }) {
  useEffect(() => {
    const mentoor: MentoorAssistant = Mentoor.init({
      projectId: 'your-project-id',
      publicKey: 'pk_live_public_browser_key',
      apiBase: 'https://mentoor.ai',
      user: userId ? { id: userId } : undefined,
      getRouteContext: () => ({
        route: window.location.pathname + window.location.hash,
      }),
    })

    return () => mentoor.destroy()
  }, [userId])

  return null
}

Next.js App Router:

'use client'

import { usePathname } from 'next/navigation'
import { useEffect } from 'react'
import { Mentoor } from '@mentoor/inline-guide'

export function MentoorClient({ userId }: { userId?: string }) {
  const pathname = usePathname()

  useEffect(() => {
    const mentoor = Mentoor.init({
      projectId: 'your-project-id',
      publicKey: 'pk_live_public_browser_key',
      apiBase: 'https://mentoor.ai',
      user: userId ? { id: userId } : undefined,
      getRouteContext: () => ({
        route: window.location.pathname + window.location.hash,
      }),
    })

    return () => mentoor.destroy()
  }, [pathname, userId])

  return null
}

TypeScript

Mentoor exports first-class Mentoor names for the public SDK:

import {
  Mentoor,
  createMentoorGuide,
  type MentoorAssistant,
  type MentoorAssistantOptions,
  type MentoorGuideOptions,
  type MentoorGuideStep,
  type MentoorTargetFingerprint,
} from '@mentoor/inline-guide'

The package exports Mentoor-named helpers and types for new installs.

Launch Checklist

  • Use only the pk_ public browser key from Studio in frontend code.
  • Add every production app URL to the project's allowed origins.
  • Keep apiBase pointed at the Mentoor API host.
  • Mark stable controls with data-mentoor so guides can find the right action.
  • Mark private regions with data-mentoor-ignore when Mentoor should not read or guide inside them.
  • Keep authentication, permissions, forms, and destructive actions owned by your app.

Package Details

  • ESM: dist-lib/index.js
  • CommonJS/UMD: dist-lib/index.umd.cjs
  • Types: dist-lib/index.d.ts
  • Runtime dependencies: none
  • Browser support: modern browsers with standard DOM APIs

Development

npm install
npm run build:lib
npm run lint
npm test

The hosted Mentoor app/API can be deployed separately. The npm package is only the browser SDK.