{"id":30622425,"url":"https://github.com/rohannagar/op-connect-sdk-java","last_synced_at":"2026-03-05T19:05:32.218Z","repository":{"id":38457100,"uuid":"358429875","full_name":"RohanNagar/op-connect-sdk-java","owner":"RohanNagar","description":"An unofficial Java SDK for 1Password Connect","archived":false,"fork":false,"pushed_at":"2025-08-29T09:02:22.000Z","size":425,"stargazers_count":9,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-29T13:02:42.478Z","etag":null,"topics":["1p","1password","api","automation","central","client","connect","docker","java","library","maven","op","opconnect","password","password-manager","passwords","sdk","secrets","vault"],"latest_commit_sha":null,"homepage":"","language":"Java","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/RohanNagar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-04-16T00:32:15.000Z","updated_at":"2025-08-29T09:02:19.000Z","dependencies_parsed_at":"2023-02-10T02:00:53.388Z","dependency_job_id":"a0a11e8d-3bd9-49d4-8648-52640e7dc1cb","html_url":"https://github.com/RohanNagar/op-connect-sdk-java","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/RohanNagar/op-connect-sdk-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RohanNagar%2Fop-connect-sdk-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RohanNagar%2Fop-connect-sdk-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RohanNagar%2Fop-connect-sdk-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RohanNagar%2Fop-connect-sdk-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RohanNagar","download_url":"https://codeload.github.com/RohanNagar/op-connect-sdk-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RohanNagar%2Fop-connect-sdk-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272871256,"owners_count":25007133,"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-08-30T02:00:09.474Z","response_time":77,"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":["1p","1password","api","automation","central","client","connect","docker","java","library","maven","op","opconnect","password","password-manager","passwords","sdk","secrets","vault"],"created_at":"2025-08-30T15:38:04.955Z","updated_at":"2026-03-05T19:05:32.139Z","avatar_url":"https://github.com/RohanNagar.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 1Password Connect Java SDK\n\n\u003ca href=\"https://central.sonatype.com/artifact/com.sanctionco.opconnect/opconnect-java/0.5.3\"\u003e\n  \u003cimg src=\"https://img.shields.io/maven-central/v/com.sanctionco.opconnect/opconnect-java.svg?colorB=brightgreen\u0026label=maven%20central\" alt=\"Maven Central\"\u003e\n\u003c/a\u003e\n\u003ca href=\"http://javadoc.io/doc/com.sanctionco.opconnect/opconnect-java\"\u003e\n  \u003cimg src=\"http://javadoc.io/badge/com.sanctionco.opconnect/opconnect-java.svg\" alt=\"Javadoc\"\u003e\n\u003c/a\u003e\n\nAn unofficial SDK for interacting with the\n[1Password Connect API](https://support.1password.com/connect-api-reference).\nTested with the latest version of the 1Password Connect Server (v1.6).\n\n**NOTE: Until version 1.0.0, any new release may contain breaking changes!**\n\nStill a work in progress, feel free to submit pull requests or issues if you encounter\nbugs or need additional enhancements.\n\n## Installation\n\nAdd this library as a dependency in your `pom.xml`:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.sanctionco.opconnect\u003c/groupId\u003e\n  \u003cartifactId\u003eopconnect-java\u003c/artifactId\u003e\n  \u003cversion\u003e0.5.3\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Setup\n\nBefore you can use the 1Password Connect API, make sure that you follow\nstep 1 and 2 of the\n[1Password Secrets Automation Setup Guide](https://support.1password.com/secrets-automation/)\nin order to set up a local 1Password Connect server with Docker or Kubernetes.\n\n## Usage\n\nCreate a client:\n\n```java\nOPConnectClient client = OPConnectClient.builder()\n    .withEndpoint(\"http://localhost:8080\")\n    .withAccessToken(\"OP_ACCESS_TOKEN\")\n    .build();\n```\n\nBelow are examples of how to call each of the API methods,\nin both blocking and non-blocking form.\n\n### List vaults\n\n```java\nList\u003cVault\u003e vaults = client.listVaults().join();\n```\n\n```java\nclient.listVaults().whenComplete((vaults, throwable) -\u003e {\n  // vaults variable contains the list of vaults\n});\n```\n\n#### With a Filter\n\n```java\nList\u003cVault\u003e vaults = client\n    .listVaults(Filter.name().contains(\"My Vault\"))\n    .join();\n```\n\n```java\nclient.listVaults(Filter.name().contains(\"My Vault\"))\n    .whenComplete((vaults, throwable) -\u003e {\n      // vaults variable contains the list of vaults\n    });\n```\n\n### Get vault details\n\n```java\nVault vault = client.getVault(\"VAULTID\").join();\n```\n\n```java\nclient.getVault(\"VAULTID\").whenComplete((vault, throwable) -\u003e {\n  // vault variable contains the vault\n});\n```\n\n### List items\n\n```java\nList\u003cItem\u003e items = client.listItems(\"VAULTID\").join();\n```\n\n```java\nclient.listItems(\"VAULTID\").whenComplete((items, throwable) -\u003e {\n  // items variable contains the list of items\n});\n```\n\n#### With a Filter\n\n```java\nFilter filter = Filter.title().contains(\"Login\");\n\nList\u003cItem\u003e loginItems = client.listItems(\"VAULTID\", filter).join();\n```\n\n```java\nFilter filter = Filter.title()\n    .contains(\"Test\")\n    .or(Filter.title().equals(\"Test2\"))\n\nclient.listItems(\"VAULTID\", filter).whenComplete((testItems, throwable) -\u003e {\n  // testItems variable contains the list of items\n});\n```\n\n### Add an item\n\n```java\nItem itemToCreate = Item.builder()\n    .withTitle(\"My Login Item\")\n    .withCategory(Category.LOGIN)\n    .withVaultId(\"VAULTID\")\n    .withField(Field.username(\"myemail@test.com\").build())\n    .withField(Field.generatedPassword(\n        GeneratorRecipe.letters().ofLength(30)).build())\n    .withUrl(URL.primary(\"https://www.test.com\"))\n    .build();\n    \nItem createdItem = client.createItem(\"VAULTID\", itemToCreate).join();\n```\n\n```java\nItem itemToCreate = Item.builder()\n    .withTitle(\"My Login Item\")\n    .withCategory(Category.LOGIN)\n    .withVaultId(\"VAULTID\")\n    .withField(Field.username(\"myemail@test.com\").build())\n    .withField(Field.generatedPassword(\n        GeneratorRecipe.letters().ofLength(30)).build())\n    .withUrl(URL.primary(\"https://www.test.com\"))\n    .build();\n    \nclient.createItem(\"VAULTID\", itemToCreate).whenComplete((item, throwable) -\u003e {\n  // item variable contains the created item\n});\n```\n\n### Get item details\n\n```java\nItem item = client.getItem(\"VAULTID\", \"ITEMID\").join();\n```\n\n```java\nclient.getItem(\"VAULTID\", \"ITEMID\").whenComplete((item, throwable) -\u003e {\n  // item variable contains the item\n});\n```\n\n### Replace an item\n\n```java\nItem existing = client.getItem(\"VAULTID\", \"ITEMID\").join();\n    \nItem replacement = Item.builder()\n    .fromItem(existing)\n    .withTitle(\"New title\")\n    .build();\n\nItem replaced = client.replaceItem(\"VAULTID\", \"ITEMID\", replacement).join();\n```\n\n```java\nclient.getItem(\"VAULTID\", \"ITEMID\").thenCompose(item -\u003e {\n  Item replacement = Item.builder()\n    .fromItem(item)\n    .withTitle(\"New title\")\n    .build();\n  \n  return client.replaceItem(\"VAULTID\", \"ITEMID\", replacement);\n}).whenComplete((item, throwable) -\u003e {\n    // item variable contains the replaced item\n});\n```\n\n### Move an item to the trash\n\n```java\nclient.deleteItem(\"VAULTID\", \"ITEMID\").join();\n```\n\n```java\nclient.deleteItem(\"VAULTID\", \"ITEMID\").whenComplete((unused, throwable) -\u003e {\n  // delete does not return the item\n});\n```\n\n### Change item details\n\n```java\nItem patched = client\n    .patchItem(\"VAULTID\", \"ITEMID\", Patch.remove().withPath(\"/title\").build())\n    .join();\n```\n\n```java\nclient.patchItem(\"VAULTID\", \"ITEMID\", Patch.remove().withPath(\"/title\").build())\n    .whenComplete((item, throwable) -\u003e {\n      // item variable contains the patched item\n    });\n```\n\n### List Files\n\n```java\nList\u003cFile\u003e files = client\n    .listFiles(\"VAULTID\", \"ITEMID\")\n    .join();\n```\n\n```java\nclient.listFiles(\"VAULTID\", \"ITEMID\")\n    .whenComplete((files, throwable) -\u003e {\n      // files variable contains the list of files\n    });\n```\n\n#### With Inline Content\n\n```java\nList\u003cFile\u003e files = client\n    .listFiles(\"VAULTID\", \"ITEMID\", true)\n    .join();\n```\n\n```java\nclient.listFiles(\"VAULTID\", \"ITEMID\", true)\n    .whenComplete((files, throwable) -\u003e {\n      // files variable contains the list of files\n    });\n```\n\n### Get a File\n\n```java\nFile file = client.getFile(\"VAULTID\", \"ITEMID\", \"FILEID\").join();\n```\n\n```java\nclient.getFile(\"VAULTID\", \"ITEMID\", \"FILEID\")\n    .whenComplete((file, throwable) -\u003e {\n      // file variable contains the file details\n    });\n```\n\n#### With Inline Content\n\n```java\nFile file = client.getFile(\"VAULTID\", \"ITEMID\", \"FILEID\", true).join();\n```\n\n```java\nclient.getFile(\"VAULTID\", \"ITEMID\", \"FILEID\", true)\n    .whenComplete((file, throwable) -\u003e {\n      // file variable contains the file details\n    });\n```\n\n### Get the Content of a File\n\n```java\nString content = client\n    .getFileContent(\"VAULTID\", \"ITEMID\", \"FILEID\")\n    .join();\n```\n\n```java\nclient.getFileContent(\"VAULTID\", \"ITEMID\", \"FILEID\")\n    .whenComplete((content, throwable) -\u003e {\n      // content variable contains the file content\n    });\n```\n\n### List API activity\n\n```java\nList\u003cAPIRequest\u003e requests = client.listAPIActivity().join();\n\n// Limit to 5 requests\nList\u003cAPIRequest\u003e limitedRequests = client.listAPIActivity(5).join();\n\n// Get 10 requests, starting at index 2\nList\u003cAPIRequest\u003e limitedAndOffsetRequests = client.listAPIActivity(10, 2).join();\n```\n\n```java\nclient.listAPIActivity().whenComplete((requests, throwable) -\u003e {\n  // requests variable contains the list of requests\n});\n```\n\n### Get Health Details\n\n```java\nConnectServer serverHealth = client.health().join();\n```\n\n```java\nclient.health().whenComplete((serverHealth, throwable) -\u003e {\n  // serverHealth variable contains the server health details\n});\n```\n\n### Heartbeat\n\n```java\nclient.heartbeat().join(); // throws exception if heartbeat fails\n```\n\n```java\nclient.heartbeat().exceptionally(throwable -\u003e {\n  // execution reaches here if heartbeat failed\n});\n```\n\n### Get Connect Server Metrics\n\n```java\nString metrics = client.metrics().join();\n```\n\n```java\nclient.metrics().whenComplete((metrics, throwable) -\u003e {\n  // metrics variable contains the metrics in text form\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohannagar%2Fop-connect-sdk-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frohannagar%2Fop-connect-sdk-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohannagar%2Fop-connect-sdk-java/lists"}