{"id":21590228,"url":"https://github.com/corbado/corbado-go","last_synced_at":"2025-04-06T23:17:29.209Z","repository":{"id":207549780,"uuid":"719139290","full_name":"corbado/corbado-go","owner":"corbado","description":"Add passkeys to your Go application with the Corbado Go SDK.","archived":false,"fork":false,"pushed_at":"2025-03-24T19:24:14.000Z","size":273,"stargazers_count":95,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-30T21:11:20.572Z","etag":null,"topics":["biometric","corbado","corbado-sdk","faceid","fido","fido2","go","go-sdk","golang","passkey","passkeys","sdk","touchid","webauthn"],"latest_commit_sha":null,"homepage":"https://www.corbado.com/passkeys/golang","language":"Go","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/corbado.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":"2023-11-15T14:37:06.000Z","updated_at":"2025-03-26T08:32:23.000Z","dependencies_parsed_at":"2023-11-23T14:29:54.511Z","dependency_job_id":"a0c4aca4-65e0-4b3d-a7fb-ca8770352423","html_url":"https://github.com/corbado/corbado-go","commit_stats":null,"previous_names":["corbado/corbado-go"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fcorbado-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fcorbado-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fcorbado-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fcorbado-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corbado","download_url":"https://codeload.github.com/corbado/corbado-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247563939,"owners_count":20958971,"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":["biometric","corbado","corbado-sdk","faceid","fido","fido2","go","go-sdk","golang","passkey","passkeys","sdk","touchid","webauthn"],"created_at":"2024-11-24T16:17:11.345Z","updated_at":"2025-04-06T23:17:29.189Z","avatar_url":"https://github.com/corbado.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg width=\"1070\" alt=\"GitHub Repo Cover\" src=\"https://github.com/corbado/corbado-php/assets/18458907/aa4f9df6-980b-4b24-bb2f-d71c0f480971\"\u003e\n\n# Corbado Go SDK\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/corbado/corbado-go.svg)](https://pkg.go.dev/github.com/corbado/corbado-go)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Test Status](https://github.com/corbado/corbado-go/workflows/tests/badge.svg)](https://github.com/corbado/corbado-go/actions?query=workflow%3Atests)\n[![Go Report Card](https://goreportcard.com/badge/github.com/corbado/corbado-go)](https://goreportcard.com/report/github.com/corbado/corbado-go)\n[![documentation](https://img.shields.io/badge/documentation-Corbado_Backend_API_Reference-blue.svg)](https://apireference.cloud.corbado.io/backendapi/)\n[![Slack](https://img.shields.io/badge/slack-join%20chat-brightgreen.svg)](https://join.slack.com/t/corbado/shared_invite/zt-1b7867yz8-V~Xr~ngmSGbt7IA~g16ZsQ)\n\nThe [Corbado](https://www.corbado.com) Go SDK provides convenient access to the [Corbado Backend API](https://apireference.cloud.corbado.io/backendapi-v2/) from applications written in the Go language.\n\n[![integration-guides](https://github.com/user-attachments/assets/7859201b-a345-4b68-b336-6e2edcc6577b)](https://app.corbado.com/getting-started?search=go)\n\n:warning: The Corbado Go SDK is commonly referred to as a private client, specifically designed for usage within closed backend applications. This particular SDK should exclusively be utilized in such environments, as it is crucial to ensure that the API secret remains strictly confidential and is never shared.\n\n:rocket: [Getting started](#rocket-getting-started) | :hammer_and_wrench: [Services](#hammer_and_wrench-services) | :books: [Advanced](#books-advanced) | :speech_balloon: [Support \u0026 Feedback](#speech_balloon-support--feedback)\n\n## :rocket: Getting started\n\n### Requirements\n\n- Go 1.18 or later\n\n### Installation\n\nUse the following command to install the Corbado Go SDK:\n\n```bash\ngo get github.com/corbado/corbado-go/v2\n```\n\n### Usage\n\nTo create a Corbado Go SDK instance you need to provide your `Project ID`, `API secret` , `Frontend API` and `Backend API` URLs which can be found at the [Developer Panel](https://app.corbado.com).\n\n```Go\npackage main\n\nimport (\n    \"github.com/corbado/corbado-go\"\n)\n\nfunc main() {\n    config, err := corbado.NewConfig(\"\u003cProject ID\u003e\", \"\u003cAPI secret\u003e\", \"\u003cFrontend API\u003e\", \"\u003cBackend API\u003e\")\n    if err != nil {\n        panic(err)\n    }\n\n    sdk, err := corbado.NewSDK(config)\n    if err != nil {\n        panic(err)\n    }\n}\n```\n\n### Examples\n\nA list of examples can be found in the [examples](/examples) directory. [Integration tests](tests/integration) are good examples as well.\n\n## :hammer_and_wrench: Services\n\nThe Corbado Go SDK provides the following services:\n\n- `Sessions` for managing sessions ([examples](examples/stdlib/session))\n- `Users` for managing users ([examples](tests/integration/user))\n- `Identifiers` for managing identifiers ([examples](tests/integration/identifier))\n\nTo use a specific service, such as `Users`, invoke it as shown below:\n\n```Go\nuser, err := sdk.Users().Get(context.Background(), \"usr-12345679\")\nif err != nil {\n    panic(err)\n}\n``` \n\n## :books: Advanced\n\n### Error handling\n\nThe Corbado Go SDK uses Go standard error handling (error interface). If the Backend API returns a HTTP status code other than 200, the Corbado Go SDK returns a `ServerError` error (which implements the error interface):\n\n```Go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n\n    \"github.com/corbado/corbado-go\"\n)\n\nfunc main() {\n    config, err := corbado.NewConfig(\"\u003cProject ID\u003e\", \"\u003cAPI secret\u003e\", \"\u003cFrontend API\u003e\", \"\u003cBackend API\u003e\")\n    if err != nil {\n        panic(err)\n    }\n\n    sdk, err := corbado.NewSDK(config)\n    if err != nil {\n        panic(err)\n    }\n\n    // Try to get non-existing user with ID 'usr-123456789'\n    user, err := sdk.Users().Get(context.Background(), \"usr-123456789\")\n    if err != nil {\n        if serverErr := corbado.AsServerError(err); serverErr != nil {\n            // Show HTTP status code (400 in this case)\n            fmt.Println(serverErr.HTTPStatusCode)\n\n            // Show request ID (can be used in developer panel to look up the full request\n            // and response, see https://app.corbado.com/app/logs/requests)\n            fmt.Println(serverErr.RequestData.RequestID)\n\n            // Show runtime of request in seconds (server side)\n            fmt.Println(serverErr.Runtime)\n\n            // Show validation error messages (server side validation in case of HTTP\n            // status code 400 (Bad Request))\n            fmt.Printf(\"%+v\\n\", serverErr.Validation)\n        } else {\n            // Handle other errors\n            panic(err)\n        }\n\n        return\n    }\n\n    fmt.Println(user.userID)\n}\n\n```\n\n## :speech_balloon: Support \u0026 Feedback\n\n### Report an issue\n\nIf you encounter any bugs or have suggestions, please [open an issue](https://github.com/corbado/corbado-go/issues/new).\n\n### Slack channel\n\nJoin our Slack channel to discuss questions or ideas with the Corbado team and other developers.\n\n[![Slack](https://img.shields.io/badge/slack-join%20chat-brightgreen.svg)](https://join.slack.com/t/corbado/shared_invite/zt-1b7867yz8-V~Xr~ngmSGbt7IA~g16ZsQ)\n\n### Email\n\nYou can also reach out to us via email at vincent.delitz@corbado.com.\n\n### Vulnerability reporting\n\nPlease report suspected security vulnerabilities in private to security@corbado.com. Please do NOT create publicly viewable issues for suspected security vulnerabilities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorbado%2Fcorbado-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorbado%2Fcorbado-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorbado%2Fcorbado-go/lists"}