{"id":28376218,"url":"https://github.com/phasehq/node-sdk","last_synced_at":"2025-06-26T10:31:19.324Z","repository":{"id":154041454,"uuid":"631517658","full_name":"phasehq/node-sdk","owner":"phasehq","description":"Encrypt / Decrypt data in Node.js","archived":false,"fork":false,"pushed_at":"2025-05-01T09:19:58.000Z","size":174,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-30T00:05:57.544Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://phase.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phasehq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-23T09:15:25.000Z","updated_at":"2025-05-01T09:20:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa85d6d7-ba75-4c7c-b970-c6b4988607ae","html_url":"https://github.com/phasehq/node-sdk","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/phasehq/node-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phasehq%2Fnode-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phasehq%2Fnode-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phasehq%2Fnode-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phasehq%2Fnode-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phasehq","download_url":"https://codeload.github.com/phasehq/node-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phasehq%2Fnode-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262047877,"owners_count":23250433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-30T00:05:58.036Z","updated_at":"2025-06-26T10:31:19.316Z","avatar_url":"https://github.com/phasehq.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js SDK for Phase\n\nSDK to integrate Phase in server-side applications running Node.js\n\n## Install\n\n`npm i @phase.dev/phase-node` or `yarn add @phase.dev/phase-node`\n\n## Import\n\n```js\nconst Phase = require(\"@phase.dev/phase-node\");\n```\n\n## Initialize\n\nInitialize the SDK with your PAT or service account token:\n\n```typescript\nconst token = 'pss_service...'\n\nconst phase = new Phase(token)\n```\n\n## Usage\n\n### Get Secrets\n\nGet all secrets in an environment:\n\n```typescript\nconst getOptions: GetSecretOptions = {\n  appId: \"3b7443aa-3a7c-4791-849a-42aafc9cbe66\",\n  envName: \"Development\",\n};\n\nconst secrets = await phase.get(getOptions);\n```\n\nGet a specific key:\n\n```typescript\nimport { GetSecretOptions } from \"@phase.dev/phase-node\";\n\nconst getOptions: GetSecretOptions = {\n  appId: \"3b7443aa-3a7c-4791-849a-42aafc9cbe66\",\n  envName: \"Development\",\n  key: \"foo\"\n};\n\nconst secrets = await phase.get(getOptions);\n```\n\n### Create Secrets\n\nCreate one or more secrets in a specified application and environment:\n\n```typescript\nimport { CreateSecretOptions } from \"@phase.dev/phase-node\";\n\nconst createOptions: CreateSecretOptions = {\n  appId: \"3b7443aa-3a7c-4791-849a-42aafc9cbe66\",\n  envName: \"Development\",\n  secrets: [\n    {\n      key: \"API_KEY\",\n      value: \"your-api-key\",\n      comment: 'test key for dev'\n    },\n    {\n      key: \"DB_PASSWORD\",\n      value: \"your-db-password\",\n      path: \"/database\",\n    }\n  ]\n};\n\nawait phase.create(createOptions);\n```\n\n### Update Secrets\n\nUpdate existing secrets in a specified application and environment:\n\n\n\n```typescript\nimport { UpdateSecretOptions } from \"@phase.dev/phase-node\";\n\nconst updateOptions: UpdateSecretOptions = {\n  appId: \"3b7443aa-3a7c-4791-849a-42aafc9cbe66\",\n  envName: \"Development\",\n  secrets: [\n    {\n      id: \"28f5d66e-b006-4d34-8e32-88e1d3478299\",\n      value: 'newvalue'\n    },\n  ],\n};\n\nawait phase.update(updateOptions);\n```\n### Delete Secrets\n\nDelete one or more secrets from a specified application and environment:\n\n```typescript\nimport { DeleteSecretOptions } from \"@phase.dev/phase-node\";\n\nconst secretsToDelete = secrets.map((secret) =\u003e secret.id);\n\nconst deleteOptions: DeleteSecretOptions = {\n  appId: \"3b7443aa-3a7c-4791-849a-42aafc9cbe66\",\n  envName: \"Development\",\n  secretIds: secretsToDelete,\n};\n\nawait phase.delete(deleteOptions);\n```\n\n## Development\n\nPlease see [CONTRIBUTING.md](CONTRIBUTING.md) for more information on how to contribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphasehq%2Fnode-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphasehq%2Fnode-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphasehq%2Fnode-sdk/lists"}