Skip to content

Commit a872628

Browse files
Merge pull request #1 from phasehq/migration
moved project, added license
2 parents d81bd39 + 3a3d7ad commit a872628

File tree

10 files changed

+10866
-1
lines changed

10 files changed

+10866
-1
lines changed

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# .gitignore
2+
3+
# Node.js dependencies
4+
node_modules/
5+
6+
# Environment and configuration files
7+
.env
8+
.env.local
9+
.env.*.local
10+
config/
11+
12+
# IDE settings
13+
.idea/
14+
.vscode/
15+
16+
# Build and output directories
17+
dist/
18+
build/
19+
20+
# Log files
21+
*.log
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*
25+
26+
# Temporary files
27+
*.tmp
28+
*.swp
29+
*.swo
30+
*.bak
31+
*.orig
32+
*.lock
33+
34+
# OS generated files
35+
.DS_Store
36+
Thumbs.db

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,35 @@
1-
# server-node-sdk
1+
# Node.js SDK for Phase
2+
3+
SDK to integrate Phase in server-side applications running Node.js
4+
5+
## Install
6+
7+
`npm i @phase.dev/phase-node` or `yarn add @phase.dev/phase-node`
8+
9+
## Import
10+
11+
```js
12+
const Phase = require("@phase.dev/phase-node").default;
13+
```
14+
15+
## Initialize
16+
17+
Initialize the SDK with your `APP_ID` and `APP_SECRET`:
18+
19+
```js
20+
const phase = new Phase(APP_ID, APP_SECRET);
21+
```
22+
23+
## Usage
24+
25+
### Encrypt
26+
27+
```js
28+
const ciphertext = await phase.encrypt("hello world");
29+
```
30+
31+
### Decrypt
32+
33+
```js
34+
const plaintext = await phase.decrypt(ciphertext);
35+
```

0 commit comments

Comments
 (0)