{"id":41689647,"url":"https://github.com/synpse-hq/synpse-go","last_synced_at":"2026-01-24T20:12:59.089Z","repository":{"id":45473481,"uuid":"429857450","full_name":"synpse-hq/synpse-go","owner":"synpse-hq","description":"Synpse Go client to orchestrate your IoT and server infrastructure","archived":false,"fork":false,"pushed_at":"2022-07-14T08:18:10.000Z","size":92,"stargazers_count":6,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-19T19:47:52.513Z","etag":null,"topics":["ai","containers","edge-computing","golang","iot","iot-platform"],"latest_commit_sha":null,"homepage":"https://synpse.net","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/synpse-hq.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}},"created_at":"2021-11-19T16:05:54.000Z","updated_at":"2024-06-19T19:47:52.514Z","dependencies_parsed_at":"2022-07-15T04:00:36.945Z","dependency_job_id":null,"html_url":"https://github.com/synpse-hq/synpse-go","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/synpse-hq/synpse-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synpse-hq%2Fsynpse-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synpse-hq%2Fsynpse-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synpse-hq%2Fsynpse-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synpse-hq%2Fsynpse-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/synpse-hq","download_url":"https://codeload.github.com/synpse-hq/synpse-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synpse-hq%2Fsynpse-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28736500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T19:23:36.361Z","status":"ssl_error","status_checked_at":"2026-01-24T19:23:28.966Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ai","containers","edge-computing","golang","iot","iot-platform"],"created_at":"2026-01-24T20:12:57.705Z","updated_at":"2026-01-24T20:12:59.084Z","avatar_url":"https://github.com/synpse-hq.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n  \u003cimg src=\"https://github.com/synpse-hq/synpse/blob/main/assets/logo.png\" width=\"200px\"\u003e\n  \u003cbr\u003e\n\n  **The easiest way to bootstrap your devices and deploy applications.    \n  Synpse manages OTA deployment \u0026 updates, provides SSH and network access.**\n\n  ---\n\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://synpse.net\"\u003eWebsite\u003c/a\u003e •\n    \u003ca href=\"https://github.com/synpse-hq/synpse/discussions\"\u003eDiscussions\u003c/a\u003e •  \n    \u003ca href=\"https://docs.synpse.net\"\u003eDocs\u003c/a\u003e •  \n    \u003ca href=\"https://discord.gg/dkgN4vVNdm\"\u003eDiscord\u003c/a\u003e •\n    \u003ca href=\"https://cloud.synpse.net/\"\u003eCloud\u003c/a\u003e\n  \u003c/p\u003e\n\n\u003c/div\u003e\n\n\n## Synpse v1 API client\n\n[![Build Status](https://drone-kr.webrelay.io/api/badges/synpse-hq/synpse-go/status.svg)](https://drone-kr.webrelay.io/synpse-hq/synpse-go)\n[![Doc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/synpse-hq/synpse-go?tab=doc)\n\nSynpse provides your device fleet management, application deployment and their configuration. Whole process is simple with very low learning curve.\n\n* 🚧 This API client is still under active development, the methods can be changed 🚧 *\n\n---\n\n- [Synpse v1 API client](#synpse-v1-api-client)\n- [Prerequisites](#prerequisites)\n- [Install](#install)\n- [Authentication](#authentication)\n- [Examples](#examples)\n\t- [Registering New Device](#registering-new-device)\n\t- [List Devices](#list-devices)\n\t- [Create Application](#create-application)\n\t- [Update Application](#update-application)\n\t- [List Applications](#list-applications)\n\t- [Delete Applications:](#delete-applications)\n\n## Prerequisites\n\n- [Go](https://golang.org/dl/)\n- [Synpse account](https://cloud.synpse.net/) - free up to 5 devices.\n\n## Install\n\n```shell\ngo get github.com/synpse-hq/synpse-go\n```\n\n## Authentication\n\nTo authenticate, we recommend using a project level access key that you can generate here: https://cloud.synpse.net/service-accounts.\n\nAlternatively, use [Personal Access Keys](https://cloud.synpse.net/access-keys), however, they will be able to manage multiple projects.\n\n\n## Examples\n\nLet's start with creating an client API:\n\n```golang\npackage main\n\nimport (\n  \"os\"\n  \"fmt\"\n\n  \"github.com/synpse-hq/synpse-go\"\n)\n\nfunc main() {\n  // Create a new API client with a specified access key. You can get your access key\n  // from https://cloud.synpse.net/service-accounts\n  apiClient, _ := synpse.NewWithProject(os.Getenv(\"SYNPSE_PROJECT_ACCESS_KEY\"), os.Getenv(\"SYNPSE_PROJECT_ID\"))    \n}\n```\n\n### Registering New Device\n\nWhen automating your device fleet operations, you will most likely need to create and manage [device registration tokens](https://docs.synpse.net/synpse-core/devices/provisioning). These tokens can be created with a set of labels and environment variables which will then be inherited by any device that registers using it.\n\n```golang\n  // In this example we use user ID but it could be anything else like company name, location identifier, etc.\n  var userID = \"usr_mkalpxzlab\"\n  // Optional max registrations. It's a good practice to set these to sane limits. If you expect only one device\n  // to register with this token, set it to 1.\n  var maxRegistrations = 10\n\n  // Create a registration token\n  drt, _ := apiClient.CreateRegistrationToken(ctx, synpse.DeviceRegistrationToken{\n    Name:                 \"drt-\" + userID,\n    MaxRegistrations:     \u0026maxRegistrations,                 // optional \n    Labels:               map[string]string{\"user\": userID}, // optional\n  })\n\n  // Use this token together with your project ID:\n  // \n  // curl https://downloads.synpse.net/install.sh | \\\n  //   AGENT_PROJECT={{ PROJECT_ID }} \\\n  //   AGENT_REGISTRATION_TOKEN={{ DEVICE_REGISTRATION_TOKEN }} \\\n  //   bash\n\n\n  // Once registration token is created, you can use device filtering to find it:\n  devicesResp, _ := apiClient.ListDevices(context.Background(), \u0026synpse.ListDevicesRequest{\n    Labels: map[string]string{\n      \"user\": userID, \n    },\n  })\n\n```\n\n\n### List Devices\n\n```golang\n  // List devices\n  devicesResp, _ := apiClient.ListDevices(context.Background(), \u0026synpse.ListDevicesRequest{})\n\n  // Print device names\n  for _, device := range devicesResp.Devices {\n    fmt.Println(device.Name)\n  }\n```\n\nHere we list an already registered devices. Default page size is 100, if you have more devices, use pagination options and iterate for as long as you have the next page token.\n\nFiltering devices during the query is almost always the preferred solution. You can filter devices by labels:\n\n```golang\n  // List devices that have this label\n  devicesResp, _ := apiClient.ListDevices(context.Background(), \u0026synpse.ListDevicesRequest{\n    Labels: map[string]string{\n      \"group\": \"one\", \n    },\n  })\n```\n\n### Create Application\n\nApplications in Synpse can either:\n- Run on all devices in the project\n- Run on devices with matching labels\n\nTo create an application that will run on all devices:\n\n```golang\n  // Create an application in 'default' namespace that will be deployed on all devices\n  application, err := apiClient.CreateApplication(context.Background(), \"default\", synpse.Application{\n    Name:        \"app-name\",\n    Scheduling: synpse.Scheduling{\n      Type: synpse.ScheduleTypeAllDevices,\n    },\n    Spec: synpse.ApplicationSpec{\n      ContainerSpec: []synpse.ContainerSpec{\n        {\n          Name:  \"hello\",\n          Image: \"quay.io/synpse/hello-synpse-go:latest\",\n          Ports: []string{\"8080:8080\"},\n        },\n      },\n    },\n  })\n```\n\nor only on specific devices, based on label selector:\n\n```golang\n  // Create an application that will be deployed on devices that have our specified label\n  application, err := apiClient.CreateApplication(context.Background(), \"default\", synpse.Application{\n    Name:        \"app-name\",\n    Scheduling: synpse.Scheduling{\n      Type: synpse.ScheduleTypeConditional,\n      Selector: {\n        \"location\": \"power-plant\",\n      }\n    },\n    Spec: synpse.ApplicationSpec{\n      ContainerSpec: []synpse.ContainerSpec{\n        {\n          Name:  \"hello\",\n          Image: \"quay.io/synpse/hello-synpse-go:latest\",\n          Ports: []string{\"8080:8080\"},\n        },\n      },\n    },\n  })\n```\n\n### Update Application\n\nDuring the normal lifecycle, you will be updating application many times. For example if you want to update the Docker image or expose additional ports, use the `UpdateApplication` method:\n\n```golang\n  // Create an application that will be deployed on devices that have our specified label\n  application, err := apiClient.UpdateApplication(context.Background(), \"default\", synpse.Application{\n    ID:          app.ID,\n    Name:        \"app-name\",\n    Scheduling: synpse.Scheduling{\n      Type: synpse.ScheduleTypeConditional,\n      Selector: {\n        \"location\": \"power-plant\",\n      }\n    },\n    Spec: synpse.ApplicationSpec{\n      ContainerSpec: []synpse.ContainerSpec{\n        {\n          Name:  \"hello\",\n          Image: \"quay.io/synpse/hello-synpse-go:new\",\n          Ports: []string{\n            \"8080:8080\",\n            \"8888:8888\",            \n          },\n        },\n      },\n    },\n  })\n```\n\n### List Applications\n\nTo list applications:\n\n```golang\n    applications, err := apiClient.ListApplications(\n      context.Background(), \n      \u0026synpse.ListApplicationsRequest{Namespace: \"default\"},\n    )\n    for _, app := range applications {\n      fmt.Println(app.Name)\n    }\n```\n\n### Delete Applications:\n\nYou can remove applications by using name or ID:\n\n```golang\n  err := apiClient.DeleteApplication(context.Background(), \"default\", \"app-name\")\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynpse-hq%2Fsynpse-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsynpse-hq%2Fsynpse-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynpse-hq%2Fsynpse-go/lists"}