{"_id":"@basis-theory/basis-theory-js-encryption","_rev":"14-089a06189acb67881dcc53c2d646053c","name":"@basis-theory/basis-theory-js-encryption","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@basis-theory/basis-theory-js-encryption","version":"1.0.0","author":{"name":"Basis Theory","email":"support@basistheory.com"},"license":"Apache-2.0","_id":"@basis-theory/basis-theory-js-encryption@1.0.0","maintainers":[{"name":"bt-platform","email":"platform@basistheory.com"},{"name":"sabriskaybt","email":"sabrina@basistheory.com"},{"name":"dhudec","email":"drew@basistheory.com"},{"name":"adamletizia","email":"adam@basistheory.com"},{"name":"briangonzalezatbt","email":"brian.gonzalez@basistheory.com"},{"name":"lcschy","email":"lucas@basistheory.com"},{"name":"davi.basistheory","email":"davi@basistheory.com"},{"name":"matthew_basistheory","email":"matthew@basistheory.com"},{"name":"bweber36","email":"brandon@basistheory.com"},{"name":"armsteadj1","email":"armsteadj1@gmail.com"}],"homepage":"https://github.com/Basis-Theory/basis-theory-js-encryption#readme","bugs":{"url":"https://github.com/Basis-Theory/basis-theory-js-encryption/issues"},"dist":{"shasum":"209cf9738c7da70087d04f4c75129f0e3d44cf00","tarball":"https://registry.npmjs.org/@basis-theory/basis-theory-js-encryption/-/basis-theory-js-encryption-1.0.0.tgz","fileCount":21,"integrity":"sha512-G8o/KZXFVSMDzbCppcKpS8h66Etx6Vvu0oivekktlmsMPoou84o6R6hO0GkMMCxImZIm/AbnQuVujiat98iHIw==","signatures":[{"sig":"MEUCIC2s8GRSCB6TdjIVleES6Wm1sGkb3EmRw+V34LvPwJ9IAiEAkma1VA0iK5rCFehAsymPn5UBzOg/bTLN7UuGN8s0SwI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":58075},"main":"dist/index.js","module":"dist/index.js","engines":{"node":">=10.12.0"},"gitHead":"0073e8e8e769905d0eeb3bb46d52a2ece922a41c","scripts":{"lint":"eslint . --quiet --ignore-path .gitignore","size":"size-limit","test":"jest","build":"yarn clean && concurrently \"yarn build:bundle\" \"yarn build:module\" \"yarn build:declarations\" \"yarn build:package\" --kill-others-on-fail","clean":"rimraf dist","start":"webpack --config webpack.dev.js --watch","prepare":"yarn build","release":"semantic-release","lint:fix":"eslint . --fix --ignore-path .gitignore","test:cov":"jest --coverage","postinstall":"husky install","build:bundle":"webpack --config webpack.prod.js","build:module":"babel src --extensions .ts --out-dir dist","pretty-quick":"pretty-quick --staged","build:package":"node prepare.js","build:declarations":"tsc"},"typings":"dist/index.d.ts","_npmUser":{"name":"bt-platform","email":"platform@basistheory.com"},"prettier":"@basis-theory/eslint-config/prettier","repository":{"url":"git+https://github.com/Basis-Theory/basis-theory-js-encryption.git","type":"git"},"size-limit":[{"path":"dist/basis-theory-js-encryption.bundle.js","limit":"50 KB"}],"_npmVersion":"7.20.5","description":"The [Basis Theory](https://basistheory.com/) JS Encryption SDK","directories":{},"_nodeVersion":"14.17.6","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","uuid":"^8.3.2","husky":"^5.1.1","chance":"^1.1.7","eslint":"^7.32.0","rimraf":"^3.0.2","ts-jest":"^26.5.0","webpack":"^5.20.2","prettier":"^2.3.2","is-base64":"^1.1.0","@babel/cli":"^7.12.16","size-limit":"^4.9.1","typescript":"^4.2.3","@babel/core":"^7.12.13","@types/jest":"^26.0.20","@types/uuid":"^8.3.1","webpack-cli":"^4.5.0","babel-loader":"^8.2.2","concurrently":"5.3.0","pretty-quick":"^3.1.0","@types/chance":"^1.1.1","webpack-merge":"^5.7.3","@commitlint/cli":"^12.1.1","@types/is-base64":"^1.1.0","semantic-release":"^17.3.9","@babel/preset-env":"^7.12.13","@semantic-release/git":"^9.0.0","@semantic-release/npm":"^7.0.10","@types/dotenv-webpack":"^7.0.1","webpack-bundle-analyzer":"^4.4.0","@babel/preset-typescript":"^7.12.13","@semantic-release/github":"^7.2.0","@basis-theory/eslint-config":"^1.0.4","@semantic-release/changelog":"^5.0.1","@size-limit/preset-small-lib":"^4.9.1","@babel/plugin-transform-runtime":"^7.15.0","@commitlint/config-conventional":"^12.1.1","@semantic-release/commit-analyzer":"^8.0.1","@babel/plugin-proposal-class-properties":"^7.12.13","@semantic-release/release-notes-generator":"^9.0.1"},"_npmOperationalInternal":{"tmp":"tmp/basis-theory-js-encryption_1.0.0_1632155562142_0.02467644841105865","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@basis-theory/basis-theory-js-encryption","version":"1.0.1","author":{"name":"Basis Theory","email":"support@basistheory.com"},"license":"Apache-2.0","_id":"@basis-theory/basis-theory-js-encryption@1.0.1","maintainers":[{"name":"bt-platform","email":"platform@basistheory.com"},{"name":"sabriskaybt","email":"sabrina@basistheory.com"},{"name":"dhudec","email":"drew@basistheory.com"},{"name":"adamletizia","email":"adam@basistheory.com"},{"name":"briangonzalezatbt","email":"brian.gonzalez@basistheory.com"},{"name":"lcschy","email":"lucas@basistheory.com"},{"name":"davi.basistheory","email":"davi@basistheory.com"},{"name":"matthew_basistheory","email":"matthew@basistheory.com"},{"name":"bweber36","email":"brandon@basistheory.com"},{"name":"armsteadj1","email":"armsteadj1@gmail.com"}],"homepage":"https://github.com/Basis-Theory/basis-theory-js-encryption#readme","bugs":{"url":"https://github.com/Basis-Theory/basis-theory-js-encryption/issues"},"dist":{"shasum":"32304e20367db17ac9c9ee6fcd78a5c5d73d818d","tarball":"https://registry.npmjs.org/@basis-theory/basis-theory-js-encryption/-/basis-theory-js-encryption-1.0.1.tgz","fileCount":17,"integrity":"sha512-0Bca92TOXLbZFoPmF1/ugE45Dvon4aUqbLH16/AKJjfRStNwS2A3P2uuMf1siGhqu9tkv65pROQTiaRYfd+LYw==","signatures":[{"sig":"MEYCIQDvKENOYYa21JgpAUYS7oaU4vpE93I9UFCnSxdE4VlUvgIhANubRp/DBJeB7QBFT9q7WVDG050PlPnMwrz5CHOAjcQO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28471},"main":"index.js","module":"index.js","engines":{"node":">=10.12.0"},"typings":"index.d.ts","_npmUser":{"name":"bt-platform","email":"platform@basistheory.com"},"prettier":"@basis-theory/eslint-config/prettier","repository":{"url":"git+https://github.com/Basis-Theory/basis-theory-js-encryption.git","type":"git"},"_npmVersion":"7.20.5","description":"The [Basis Theory](https://basistheory.com/) JS Encryption SDK","directories":{},"_nodeVersion":"14.17.6","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/basis-theory-js-encryption_1.0.1_1632156889916_0.7691491038644629","host":"s3://npm-registry-packages"}}},"time":{"created":"2021-09-20T16:32:42.097Z","modified":"2024-09-16T16:46:29.817Z","1.0.0":"2021-09-20T16:32:42.285Z","1.0.1":"2021-09-20T16:54:50.252Z"},"bugs":{"url":"https://github.com/Basis-Theory/basis-theory-js-encryption/issues"},"author":{"name":"Basis Theory","email":"support@basistheory.com"},"license":"Apache-2.0","homepage":"https://github.com/Basis-Theory/basis-theory-js-encryption#readme","repository":{"url":"git+https://github.com/Basis-Theory/basis-theory-js-encryption.git","type":"git"},"description":"The [Basis Theory](https://basistheory.com/) JS Encryption SDK","maintainers":[{"email":"robert@basistheory.com","name":"greathouse-bt"},{"email":"kevin@basistheory.com","name":"kevinperaza-bt"},{"email":"josue@basistheory.com","name":"jleon15"},{"email":"lucas@basistheory.com","name":"lcschy"},{"email":"brian.gonzalez@basistheory.com","name":"briangonzalezatbt"},{"email":"drew@basistheory.com","name":"dhudec"},{"email":"davi@basistheory.com","name":"davi.basistheory"},{"email":"armsteadj1@gmail.com","name":"armsteadj1"},{"email":"matthew@basistheory.com","name":"matthew_basistheory"},{"email":"platform@basistheory.com","name":"bt-platform"}],"readme":"# BasisTheory JS Encryption\n\nThe [Basis Theory](https://basistheory.com/) JS Encryption SDK\n\n## Installation\n\nUsing [Node Package Manager](https://docs.npmjs.com/)\n\n```sh\nnpm install --save @basis-theory/basis-theory-js-encryption\n```\n\nUsing [Yarn](https://classic.yarnpkg.com/en/docs/)\n\n```sh\nyarn add @basis-theory/basis-theory-js-encryption\n```\n\n## Documentation\n\nFor further documentation and examples, please refer to our [Docs](https://docs.basistheory.com/api-reference/encryption).\n\n## Usage\n\n### Initialization\n\n```javascript\nimport { BasisTheoryEncryption } from '@basis-theory/basis-theory-js-encryption';\n\nconst btEncryption = await new BasisTheoryEncryption().init([new EncryptionProvider()]); // replace with an actual provider(s)\n```\n\n### Encryption and Key Management\n\nEncryption and Key Management is provided to enable you to manage your own data encryption and key storage with your KMS provider(s) of choice.\n\n#### Key Management\n\n```javascript\nimport { BasisTheoryEncryption } from '@basis-theory/basis-theory-js-encryption';\n\n// Given provider(s) will register it's factories for the services\nconst btEncryption = await new BasisTheoryEncryption().init([new EncryptionProvider()]);\n\n// Retrieves or creates a key by name with a registered ProviderKeyFactory for the provided provider and algorithm\nlet providerEncryptionKey = await btEncryption.providerKeyService.getOrCreateKey('encryption-key', 'AZURE', 'RSA');\n\nproviderEncryptionKey = await btEncryption.providerKeyService.getKeyByKeyId(providerEncryptionKey.keyId);\n```\n\n#### Encryption and Decryption\n\n```javascript\nimport { v4 as uuid } from 'uuid';\nimport { BasisTheoryEncryption } from '@basis-theory/basis-theory-js-encryption';\n\n// Given provider will register it's factories for the services.\nconst btEncryption = await new BasisTheoryEncryption().init(new EncryptionProvider());\n\n// Provider Key which was generated from the ProviderKeyService\nlet providerEncryptionKey: ProviderEncryptionKey = {\n  keyId: uuid(),\n  providerKeyId: 'https://custom-kms.vault.azure.net/keys/encryption-key/809b10a3cedb83e83bbaeb5e8c762fab',\n  algorithm: 'RSA',\n  provider: 'AZURE'\n};\n\n// Encrypt string to get back a wrapped encryptedData with a reference to the providerEncryptionKey\nconst encryptedData = await btEncryption.encryptionService.encrypt('My Super Secret', providerEncryptionKey);\n\n// Use Encrypted Data and Provider Encryption Key to decrypt the the value and get back the original plainText\nconst plainText = await btEncryption.encryptionService.decrypt(encryptedData, providerEncryptionKey);\n```\n\n## Development\n\nThe provided scripts with the SDK will check for all dependencies, start docker, build the solution, and run all tests.\n\n### Dependencies\n\n- [NodeJS](https://nodejs.org/en/) > 10.12.0\n- [Yarn](https://classic.yarnpkg.com/en/docs/)\n\n### Build the SDK and run Tests\n\nRun the following command from the root of the project:\n\n```sh\nmake verify\n```\n","readmeFilename":"README.md"}