Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
be318c6
initial implementation of vault cli
sgaddala-ks Jun 16, 2026
2297cc2
Bump the npm_and_yarn group across 4 directories with 3 updates (#174)
dependabot[bot] Jun 17, 2026
0666226
Supply-chain security: use npm ci in CI workflows and add min-release…
tylerccarson Jun 17, 2026
490e654
fixed formatting for command outputs
sgaddala-ks Jun 18, 2026
b14b212
BE-7699 Removed leading slashes from rest messages (#179)
hleekeeper Jun 18, 2026
cf3d76a
Use preserveModules for browser dist to enable proto.js tree-shaking …
tylerccarson Jun 23, 2026
ddb62f5
NSF command implementation (list, get, ln and rm) (#175)
ukumar-ks Jun 24, 2026
384b530
removed cli package and migrated to different repo
sgaddala-ks Jun 24, 2026
24eaad1
Use logger in socket connection, add socket connection to the router.…
saldoukhov Jun 16, 2026
b056e3e
Added a new workflow to generate a PR for protobuf change (#185)
hleekeeper Jun 24, 2026
1ac6f37
chore: regenerate protobuf files (#186)
github-actions[bot] Jun 24, 2026
0f4af07
added fixes for browser compatibilty
sgaddala-ks Jun 29, 2026
f1390f3
Split proto.js into per-namespace ES modules for webpack chunk splitt…
tylerccarson Jun 29, 2026
a11459f
added additional commands p1
sgaddala-ks Jul 1, 2026
61b1656
Bump the npm_and_yarn group across 4 directories with 3 updates (#174)
dependabot[bot] Jun 17, 2026
7276104
Supply-chain security: use npm ci in CI workflows and add min-release…
tylerccarson Jun 17, 2026
c859f53
BE-7699 Removed leading slashes from rest messages (#179)
hleekeeper Jun 18, 2026
6e79fa4
Use preserveModules for browser dist to enable proto.js tree-shaking …
tylerccarson Jun 23, 2026
8138e53
NSF command implementation (list, get, ln and rm) (#175)
ukumar-ks Jun 24, 2026
1624afc
initial implementation of vault cli
sgaddala-ks Jun 16, 2026
38c3a86
migrated functions and files from sdk to cli repository
sgaddala-ks Jul 1, 2026
2bb236b
Merge remote-tracking branch 'origin/main' into feature-shell-sdk-sup…
sgaddala-ks Jul 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
node-version: '24'

- name: Lib - Install
run: npm i
run: npm ci
working-directory: ./keeperapi
env:
NPM_TOKEN: ""
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.keeper-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm install
run: npm ci

- name: Publish package
run: npm publish
2 changes: 1 addition & 1 deletion .github/workflows/publish.npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm install
run: npm ci

- name: Publish package
run: npm publish
78 changes: 78 additions & 0 deletions .github/workflows/update-proto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Update Protobuf

on:
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
update-proto:
name: Regenerate Protobuf Files
runs-on: ubuntu-latest

steps:
- name: Checkout keeper-sdk-javascript
uses: actions/checkout@v4

- name: Clone keeperapp-protobuf
run: |
cd ../
git clone --depth 1 \
--branch master \
https://x-access-token:${{ secrets.PROTO_REPO_TOKEN }}@github.com/Keeper-Security/keeperapp-protobuf.git
cd keeper-sdk-javascript

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '24'

- name: Install dependencies
run: npm ci
working-directory: ./keeperapi
env:
NPM_TOKEN: ""

- name: Regenerate protobuf files
run: npm run update-proto:es6
working-directory: ./keeperapi

- name: Check for changes
id: diff
run: |
if git diff --quiet keeperapi/src/proto.js keeperapi/src/proto.d.ts keeperapi/src/proto; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi

- name: Push branch
if: steps.diff.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b "bot/update-proto"
git add keeperapi/src/proto.js keeperapi/src/proto.d.ts keeperapi/src/proto
git commit -m "chore: regenerate protobuf files"
git push --force origin "bot/update-proto"

- name: Open PR
if: steps.diff.outputs.changed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
EXISTING=$(gh pr list --head "bot/update-proto" --state open --json number --jq length)
if [ "$EXISTING" -eq 0 ]; then
gh pr create \
--title "chore: regenerate protobuf files" \
--body "Automated protobuf regeneration from keeperapp-protobuf master branch" \
--base main \
--head "bot/update-proto"
fi

- name: Skip PR creation
if: steps.diff.outputs.changed == 'false'
run: |
echo "No changes detected in protobuf files"
55 changes: 37 additions & 18 deletions KeeperSdk/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# @keeper-security/keeper-sdk-javascript

Keeper Javascript SDK for Node.js.
Keeper JavaScript SDK for **Node** and **browser** — vault API, sharing, folders, and enterprise admin APIs.

> **CLI:** Commander-style shell commands (`dispatchCliLine`, `help`, `get`, `ls`, …) live in [**@keeper-security/keeper-shell-component**](https://www.npmjs.com/package/@keeper-security/keeper-shell-component) (or this monorepo’s `commander-javascript-cli` package). This SDK package is API-only.

[![NPM](https://img.shields.io/npm/v/@keeper-security/keeper-sdk-javascript?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/package/@keeper-security/keeper-sdk-javascript)

Expand All @@ -10,57 +12,74 @@ Keeper Javascript SDK for Node.js.
npm install @keeper-security/keeper-sdk-javascript
```

## Quickstart
## Entry points

| Environment | Import | Notes |
|-------------|--------|--------|
| Node | `@keeper-security/keeper-sdk-javascript` → `dist/index.js` | `ConsoleAuthUI`, `FileConfigLoader`, full auth |
| Browser | same package → `dist/browser.js` | Platform shim only; use in-memory session + `restore-session` |

## Quickstart (Node)

```typescript
import { KeeperVault, ConsoleAuthUI, FileConfigLoader } from '@keeper-security/keeper-sdk-javascript'

const vault = new KeeperVault({
authUI: new ConsoleAuthUI(),
configLoader: new FileConfigLoader('./keeper-config.json'),
sessionStorage: new FileConfigLoader('./keeper-config.json'),
})

await vault.login()
await vault.syncDown()
await vault.login('user@example.com', 'password')
await vault.sync()

console.log(`Loaded ${vault.records.size} records`)
console.log(`Loaded ${vault.getRecords().length} records`)
```

## Supported functionality

`KeeperVault` exposes the operations below. Enterprise features require an enterprise administrator account.
`KeeperVault` exposes vault operations. Enterprise features require an enterprise administrator account.

- **Authentication**: Login, session token login, resume session, sync, logout
- **Records**: List, search, add, update, delete, move, history
- **Folders**: List, get, create, rename, delete, change directory, folder tree
- **Shared folders**: List shared folders, share with users, update permissions
- **Sharing**: Share and unshare records, check share info
- **Teams**: List, view, add, update, delete teams
- **Users**: List, view, add, update, delete users; lock/unlock accounts; expire passwords; manage aliases and team membership

Enterprise features need an enterprise administrator account.
- **Teams / users / roles** (enterprise admin): Available via the SDK API

## Examples

Runnable scripts for the areas above are in [`examples/sdk_example`](../examples/sdk_example):
Shell CLI (`dispatchCliLine`, categorized `help`, record/folder commands) is provided by **@keeper-security/keeper-shell-component** — see that package’s `src/keeper-cli/README.md`.

Runnable SDK scripts are in [`examples/sdk_example`](../examples/sdk_example):

```bash
cd examples/sdk_example
npm install
npm run auth:login
npm run records:list
npm run records:get # interactive; similar to CLI get + share info
npm run folders:ls
npm run shared-folders:list-sf
npm run teams:list
npm run users:list
```

Shell CLI parity (same dispatch path as the vault shell):

```bash
npm run records:list:shell-cli -- --from-json /path/to/session.json
```

## Local development

From the `KeeperSdk/` directory:
From repo root, build keeperapi first:

```bash
npm install
npm run link-local
npm run build
cd keeperapi && npm install && npm run build
cd ../KeeperSdk && npm install && npm run link-local && npm run build
```

Watch types: `npm run types` (in `KeeperSdk/`).

## Related

- [`keeperapi/README.md`](../keeperapi/README.md) — core client
- [`../README.md`](../README.md) — monorepo overview
66 changes: 35 additions & 31 deletions KeeperSdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions KeeperSdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
"directory": "KeeperSdk"
},
"license": "ISC",
"main": "src/index.ts",
"main": "dist/index.js",
"browser": "dist/browser.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"clean": "rm -rf dist",
"clean": "rm -rf dist node_modules",
"rebuild": "npm run clean && npm install && npm run build",
"link-local": "npm link ../keeperapi",
"format": "prettier --write .",
"format:check": "prettier --check .",
Expand All @@ -21,8 +24,9 @@
"prepublishOnly": "npm run build"
},
"dependencies": {
"@keeper-security/keeperapi": "17.2.6",
"@keeper-security/keeperapi": "18.0.2",
"ts-node": "^10.7.0",
"asmcrypto.js": "^2.3.2",
"typescript": "^4.6.3"
},
"devDependencies": {
Expand Down
Loading
Loading