Docs/Getting Started/Installation

Installation

Install the Keystore SDK for TypeScript or Python, plus the optional CLI tool.


Installation

Keystore provides SDKs for TypeScript and Python, plus a CLI for managing tokens and credentials from your terminal.

TypeScript SDK

The @keystore/sdk package works in Node.js, Deno, Bun, and edge runtimes that support globalThis.fetch.

npm

bash
1
npm install @keystore/sdk

pnpm

bash
1
pnpm add @keystore/sdk

yarn

bash
1
yarn add @keystore/sdk

Bun

bash
1
bun add @keystore/sdk

Provider peer dependencies

The SDK has optional peer dependencies for provider-specific wrappers. Install only the ones you need:

bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# OpenAI
npm install openai

# Anthropic
npm install @anthropic-ai/sdk

# Neon
npm install @neondatabase/serverless

# Resend
npm install resend

# AWS S3
npm install @aws-sdk/client-s3

If you use interceptAll(), you do not need any peer dependencies — it works by patching fetch directly.

Python SDK

The Python SDK is published as the envclaw package on PyPI.

pip

bash
1
pip install envclaw

Poetry

bash
1
poetry add envclaw

uv

bash
1
uv add envclaw

Basic usage

python
1
2
3
4
5
6
7
8
9
10
11
12
13
from envclaw import Keystore
from openai import OpenAI

ks = Keystore(agent_token="ks_a1b2c3d4e5f6...")
ks.intercept_all()

client = OpenAI(api_key="unused")
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}],
)

ks.restore()

CLI

The Keystore CLI lets you manage agent tokens, list providers, and test connections from your terminal.

bash
1
npm install -g @keystore/cli

Or with pnpm:

bash
1
pnpm add -g @keystore/cli

After installation, authenticate:

bash
1
keystore login

Environment variables

Both SDKs accept configuration through the constructor. You can also set environment variables for convenience:

VariableDescription
KEYSTORE_AGENT_TOKENDefault agent token (used if not passed to constructor)
KEYSTORE_PROXY_HOSTCustom proxy hostname (default: proxy.keystore.sh)

Next steps