Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# .gitignore

# Node.js dependencies
node_modules/

# Environment and configuration files
.env
.env.local
.env.*.local
config/

# IDE settings
.idea/
.vscode/

# Build and output directories
dist/
build/

# Log files
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Temporary files
*.tmp
*.swp
*.swo
*.bak
*.orig
*.lock

# OS generated files
.DS_Store
Thumbs.db
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# server-node-sdk
# Node.js SDK for Phase

SDK to integrate Phase in server-side applications running Node.js

## Install

`npm i @phase.dev/phase-node` or `yarn add @phase.dev/phase-node`

## Import

```js
const Phase = require("@phase.dev/phase-node").default;
```

## Initialize

Initialize the SDK with your `APP_ID` and `APP_SECRET`:

```js
const phase = new Phase(APP_ID, APP_SECRET);
```

## Usage

### Encrypt

```js
const ciphertext = await phase.encrypt("hello world");
```

### Decrypt

```js
const plaintext = await phase.decrypt(ciphertext);
```
Loading