This repository is an example TS Node project using Bitwarden's Secrets Manager SDK.
git clone https://github.com/coltonhurst/bw-napi-test.git
- Update
src/index.ts
with the correct values to connect to your Bitwarden servers and organization npm ci
npm run start
npm init -y
npm install typescript --save-dev
npm i -D @types/node
- In
package.json
:- Set
"type"
to"module"
- Add this script:
"start": "tsc && node ./dist/index.js"
- Set
- Create a
src
dir - Create
src/index.ts
- Create a
tsconfig.json
file based on the one below
For this project (bw-napi-test
), I then installed the SM SDK (npm link) and used the getting started code.
{
"compilerOptions": {
"module": "NodeNext", // defines the module system
"moduleResolution": "NodeNext", // how TS finds code you import
"target": "ES2020", // version of JS your code compiles to
"sourceMap": true, // maps JS back to TS, helps with debugging
"outDir": "dist", // where final JS output goes
},
"include": ["src/**/*"], // where TS finds our code
}