{"id":35061074,"url":"https://github.com/murka/outlinevpn-api","last_synced_at":"2025-12-27T10:32:26.213Z","repository":{"id":57764431,"uuid":"474108221","full_name":"murka/outlinevpn-api","owner":"murka","description":"Nodejs Client package for Jigsaw-Code/outline-server","archived":false,"fork":false,"pushed_at":"2024-11-14T21:15:52.000Z","size":53,"stargazers_count":36,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-11T17:29:55.727Z","etag":null,"topics":["outline","vpn"],"latest_commit_sha":null,"homepage":"","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/murka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2022-03-25T17:39:29.000Z","updated_at":"2025-07-31T21:29:02.000Z","dependencies_parsed_at":"2024-10-27T12:07:44.184Z","dependency_job_id":"ba61b4ec-5f06-4e43-a7b7-0f8008ba4c16","html_url":"https://github.com/murka/outlinevpn-api","commit_stats":{"total_commits":58,"total_committers":2,"mean_commits":29.0,"dds":"0.051724137931034475","last_synced_commit":"3a0fc741b48bcff3eea968557cb8aa9b9b7341d3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/murka/outlinevpn-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murka%2Foutlinevpn-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murka%2Foutlinevpn-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murka%2Foutlinevpn-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murka%2Foutlinevpn-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/murka","download_url":"https://codeload.github.com/murka/outlinevpn-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murka%2Foutlinevpn-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28077509,"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","status":"online","status_checked_at":"2025-12-27T02:00:05.897Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["outline","vpn"],"created_at":"2025-12-27T10:32:23.616Z","updated_at":"2025-12-27T10:32:26.202Z","avatar_url":"https://github.com/murka.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Outline VPN API\n\nBadges: [![DeepScan grade](https://deepscan.io/api/teams/19161/projects/22495/branches/665831/badge/grade.svg)](https://deepscan.io/dashboard#view=project\u0026tid=19161\u0026pid=22495\u0026bid=665831)\n\nA Nodejs Client package for managing Outline servers: [Jigsaw-Code/outline-server](https://github.com/Jigsaw-Code/outline-server)\n\nGitHub: [github.com/murka/outlinevpn-api](https://github.com/murka/outlinevpn-api)  \nNPM: [npm.im/outlinevpn-api](https://npm.im/outlinevpn-api)\n\n# Usage\n\n```ts\nimport { OutlineVPN } from \"outlinevpn-api\";\n\nconst client = new OutlineVPN({\n  apiUrl: \"https://your-server.com/api\",\n  fingerprint: \"your-server-certificate-fingerprint\",\n});\n```\n\n## Server Management\n\n### Get Server Info\n\n```ts\n// Returns: Server details including name, ID, metrics status etc.\nconst server = await client.getServer();\n```\n\n### Rename Server\n\n```ts\nconst success = await client.renameServer(\"My Server\");\n```\n\n### Configure Server Settings\n\n#### Set Hostname\n\n```ts\nconst success = await client.setHostnameForAccessKeys(\"example.com\");\n```\n\n#### Set Default Port\n\n```ts\nconst success = await client.setPortForNewAccessKeys(12345);\n```\n\n#### Manage Data Limits\n\n```ts\n// Set default data limit for new keys\nawait client.setDefaultDataLimit(1000000000); // 1GB in bytes\n\n// Remove default data limit\nawait client.deleteDefaultDataLimit();\n```\n\n### Access Key Management\n\n#### List Access Keys\n\n```ts\nconst accessKeys = await client.getAccessKeys();\n```\n\n#### Create Access Key\n\n```ts\n// Create with default settings\nconst key = await client.createAccessKey();\n\n// Create with custom options\nconst customKey = await client.createAccessKey({\n  name: \"Custom Key\",\n  password: \"custom-password\",\n  port: 8388,\n});\n\n// Create with specific ID\nconst keyWithId = await client.createAccessKeyWithId(\"custom-id\", {\n  name: \"Named Key\",\n});\n```\n\n#### Manage Existing Access Key\n\n```ts\n// Get specific key\nconst key = await client.getAccessKey(\"key-id\");\n\n// Rename key\nawait client.renameAccessKey(\"key-id\", \"New Name\");\n\n// Set data limit for key\nawait client.addDataLimit(\"key-id\", 1000000000); // 1GB\n\n// Remove data limit\nawait client.deleteDataLimit(\"key-id\");\n\n// Delete key\nawait client.deleteAccessKey(\"key-id\");\n```\n\n## Metrics\n\n### Usage Statistics\n\n```ts\n// Get data usage per access key\nconst usage = await client.getDataUsage();\n\n// Get metrics sharing status\nconst metrics = await client.getShareMetrics();\n\n// Enable/disable metrics sharing\nawait client.setShareMetrics(true);\n```\n\n## Error Handling\n\nThe API throws several types of errors:\n\n```ts\ntry {\n  await client.getAccessKey(\"non-existent\");\n} catch (error) {\n  if (error instanceof NotFoundError) {\n    // Handle 404\n  } else if (error instanceof ValidationError) {\n    // Handle validation errors\n  } else if (error instanceof OutlineError) {\n    // Handle other API errors\n  }\n}\n```\n\n# Types\n\n## Server\n\n```ts\ninterface Server {\n  name: string;\n  serverId: string;\n  metricsEnabled: boolean;\n  createdTimestampMs: number;\n  portForNewAccessKeys?: number;\n  hostnameForAccessKeys?: string;\n  accessKeyDataLimit?: {\n    bytes: number;\n  };\n  version?: string;\n}\n```\n\n## Access Key\n\n```ts\ninterface AccessKey {\n  id: string;\n  name: string;\n  password: string;\n  port: number;\n  method: string;\n  accessUrl: string;\n  limit?: {\n    bytes: number;\n  };\n}\n```\n\n# Response Codes\n\n| Code | Description                          |\n| ---- | ------------------------------------ |\n| 200  | Successful GET request               |\n| 201  | Resource created successfully        |\n| 204  | Successful operation with no content |\n| 400  | Invalid request/parameters           |\n| 404  | Resource not found                   |\n| 409  | Conflict (e.g., port already in use) |\n| 500  | Server error                         |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurka%2Foutlinevpn-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmurka%2Foutlinevpn-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurka%2Foutlinevpn-api/lists"}