Skip to content
Merged
5 changes: 5 additions & 0 deletions .changeset/friendly-files-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sigmacomputing/node-embed-sdk": minor
---

Add OAuth token encryption utils for JWT embeds
10 changes: 10 additions & 0 deletions packages/node-embed-sdk/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: ["@sigmacomputing/eslint-config/react-internal.js"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.lint.json",
tsconfigRootDir: __dirname,
},
};
47 changes: 47 additions & 0 deletions packages/node-embed-sdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Sigma Node.js Embed SDK

This package provides Node.js utilities for working with Sigma Computing's Embed API.

## Getting Started

To use the node-embed-sdk in your project, you can install it using your node package manager.

**Using npm:**

```code
npm install @sigmacomputing/node-embed-sdk
```

**yarn:**

```code
yarn add @sigmacomputing/node-embed-sdk
```

**pnpm:**

```code
pnpm add @sigmacomputing/node-embed-sdk
```

## Features

### Token Encryption and Decryption

The SDK provides utilities for encrypting and decrypting OAuth tokens using AES-256-GCM encryption:

```typescript
import { encrypt, decrypt } from '@sigmacomputing/node-embed-sdk';

// Encrypt an OAuth token
const encryptedToken = encrypt(
'your-embed-secret',
'your-oauth-token'
);

// Decrypt an encrypted token
const decryptedToken = decrypt(
'your-embed-secret',
encryptedToken
);
```
54 changes: 54 additions & 0 deletions packages/node-embed-sdk/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "@sigmacomputing/node-embed-sdk",
"author": "sigmacomputing",
"version": "0.1.0",
"description": "Node.js SDK for Sigma Computing with encryption/decryption utilities",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/sigmacomputing/embed-sdk.git",
"directory": "packages/node-embed-sdk"
},
"homepage": "https://sigmacomputing.com",
"bugs": {
"url": "https://github.com/sigmacomputing/embed-sdk/issues"
},
"keywords": [
"embed",
"sdk",
"sigma",
"node"
],
"scripts": {
"prepublish": "turbo run build",
"build": "tsup",
"lint": "eslint . --ext .ts",
"watch": "tsup --watch",
"typecheck": "tsc --noEmit",
"test": "echo \"Error: no test specified\" && exit 1"
},
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
"import": {
"import": "./dist/index.mjs",
"types": "./dist/index.d.mts"
},
"require": {
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"files": [
"dist"
],
"devDependencies": {
"@sigmacomputing/eslint-config": "workspace:*",
"@sigmacomputing/typescript-config": "workspace:*",
"@types/node": "^20.17.16"
},
"engines": {
"node": ">=18"
}
}
Loading