API Reference
InMemoryCredentialStore
Defined in: credentials/in-memory-credential-store.ts:52
RAM-backed CredentialStore seeded from a record of secrets.
Remarks
SECURITY: secrets are kept in plaintext in process memory and are lost on restart. Treat the instance as a trust boundary — only hand it to tools that are meant to receive real credentials.
Example
const store = new InMemoryCredentialStore({
secrets: { github_token: process.env.GITHUB_TOKEN ?? "" },
});
const token = await store.resolve("github_token");See
- CredentialStore for the interface contract.
- withCredentials for wrapping a tool with this store.
Implements
Constructors
Constructor
new InMemoryCredentialStore(options?): InMemoryCredentialStore;Defined in: credentials/in-memory-credential-store.ts:60
Create a store seeded with the given secrets.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | InMemoryCredentialStoreOptions | Seed secrets; see InMemoryCredentialStoreOptions. |
Returns
InMemoryCredentialStore
Methods
resolve()
resolve(name): Promise<string | undefined>;Defined in: credentials/in-memory-credential-store.ts:70
Resolve a placeholder name to its seeded secret value.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The placeholder name to resolve. |
Returns
Promise<string | undefined>
The secret value, or undefined if no such credential was seeded.