Meowland docs
Workbench

Component reference

CredentialSource

Controlled credential editor.

Preview

Environment references and manual keys

The host reports availability; the control does not query the environment or store keys.

packages/meowtail/stories/credential-source.stories.tsxline 13tsx
render() {
  const callbacks = {
    onSourceChange() {},
    onEnvironmentChange() {},
    onKeyChange() {},
    onReplace() {},
    onCheck() {},
  };
  return (
    <Specimens>
      <Specimen label="Environment variable" width="narrow">
        <CredentialSource
          {...callbacks}
          id="environment"
          source="environment"
          environmentName="KIMI_API_KEY"
          apiKey=""
          keepStored={false}
          hasStored={false}
          variables={[
            { name: "KIMI_API_KEY", available: true },
            { name: "OTHER_API_KEY", available: false },
            { name: "DIRECT_API_KEY", available: null },
          ]}
        />
      </Specimen>
      <Specimen label="Saved key" width="narrow">
        <CredentialSource
          {...callbacks}
          id="saved"
          source="stored"
          environmentName=""
          apiKey=""
          keepStored={true}
          hasStored={true}
        />
      </Specimen>
      <Specimen label="New key" width="narrow">
        <CredentialSource
          {...callbacks}
          id="new"
          source="stored"
          environmentName=""
          apiKey=""
          keepStored={false}
          hasStored={false}
        />
      </Specimen>
    </Specimens>
  );
}

Installation

bun add meowtail

Usage

Taken from the examples on this page.

usage.tsxtsx
import { CredentialSource } from "meowtail";

<CredentialSource
  {...callbacks}
  id="environment"
  source="environment"
  environmentName="KIMI_API_KEY"
  apiKey=""
  keepStored={false}
  hasStored={false}
  variables={[
    { name: "KIMI_API_KEY", available: true },
    { name: "OTHER_API_KEY", available: false },
    { name: "DIRECT_API_KEY", available: null },
  ]}
/>

API reference

Discovery and secret persistence belong to the host.

Props

PropTypeDefault
idRequired
string–
sourceRequired
"stored" | "environment"–
environmentNameRequired
string–
apiKeyRequired
string–
keepStoredRequired
boolean–
hasStoredRequired
boolean–
disabled
boolean–
variables
{ name: string; available: boolean | null }[]–
status
string–
onSourceChangeRequired
(source: "stored" | "environment"): void–
onEnvironmentChangeRequired
(name: string): void–
onKeyChangeRequired
(value: string): void–
onReplaceRequired
(): void–
onKeep
(): void–
onCheckRequired
(): void–

DOM parts

This component has no registry contract.

Registry

This component has no registry contract. It is a story that shows several components together.