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

@astrapi69/ai-key-vault-react

v0.3.2

Published

React UI for BYOK AI provider settings and the encrypted key vault: settings panel, provider table, key vault import/export — storage-, i18n- and UI-slot-injectable

Readme

@astrapi69/ai-key-vault-react

React UI for bring-your-own-key (BYOK) AI provider settings and the encrypted key vault. Built on @astrapi69/ai-key-vault; extracted from adaptive-learner.

The components import no storage, i18n framework, router or toast library. Everything app-specific is injected once, at the provider.

Setup

import {
    BUILTIN_REGISTRY,
    createProviderRegistry,
    BUILTIN_PROVIDERS,
} from "@astrapi69/ai-key-vault";
import {
    AiSettingsProvider,
    AiSettingsPanel,
    KeyVaultSection,
    ApiKeyRequiredNotice,
    useApiKeyStatus,
} from "@astrapi69/ai-key-vault-react";

<AiSettingsProvider
    adapter={myKeyStoreAdapter}   // implements AiKeyStoreAdapter over your storage
    registry={BUILTIN_REGISTRY}   // or createProviderRegistry([...])
    userId={currentUserId}
    t={myI18n.t}                  // (key, fallback) => string; optional
    notify={myToasts}             // { success, error, warning }; optional
    confirm={myConfirmDialog}     // (opts) => Promise<boolean>; optional
    Button={MyButton}             // design-system slots; optional (plain defaults otherwise)
    Input={MyInput}
    Link={MyRouterLink}           // { to } => element; default <a href>
>
    <AiSettingsPanel />
    <KeyVaultSection />
</AiSettingsProvider>;

Everything except adapter, registry and userId has a default, so the UI renders with zero wiring and adopts your look/behaviour as you override slots.

Styling the native file-picker button

KeyVaultImportForm's file input is plain native HTML (no slot for it - there's no sane way to inject a whole <input type="file"> replacement), so it renders as unstyled OS chrome by default, same as any bare file input. It carries a stable class, akv-file-input, so a host can style the native button from its OWN stylesheet without depending on an undocumented data-testid:

.akv-file-input::file-selector-button {
    /* also add ::-webkit-file-upload-button for older Safari/Chrome */
    cursor: pointer;
    border: 0;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--your-accent-token);
    color: var(--your-accent-fg-token);
}

The kit ships no rule of its own for it - consistent with the slot philosophy above, appearance is entirely the host's call.

What you get

  • AiSettingsPanel — provider overview, active-provider select, per-provider model overrides, and the API-key manager (save / live-test / delete, with the auto-test-on-save last-known-good backup flow).
  • KeyVaultSection + KeyVaultImportForm — passphrase-encrypted export/import of the keys, capability-aware (server-managed keys show a notice instead of a dead export form; import always works).
  • ConfiguredProvidersTable, ApiKeyRow, ApiKeyRequiredNotice, SecretInput — the building blocks, usable on their own.
  • useAiKeyStore / useApiKeyStatus — the state + gating hooks.

Capabilities

Optional adapter methods (testApiKey, backupApiKey, getApiKeyBackup, restoreApiKeyBackup) are surfaced as capabilities; the UI shows the Test button and the restore link only when the adapter implements them.

Peer dependency

react ^18 || ^19.

License

MIT