{"id":32146673,"url":"https://github.com/stanfordspezi/speziconsent","last_synced_at":"2026-04-07T17:01:07.286Z","repository":{"id":308556499,"uuid":"1032149836","full_name":"StanfordSpezi/SpeziConsent","owner":"StanfordSpezi","description":"Spezi Consent module to retrieve consent in iOS applications","archived":false,"fork":false,"pushed_at":"2026-01-22T09:13:32.000Z","size":3968,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-31T19:55:52.311Z","etag":null,"topics":["consent","ios","spezi","stanford"],"latest_commit_sha":null,"homepage":"https://swiftpackageindex.com/StanfordSpezi/SpeziConsent/documentation/speziconsent","language":"Swift","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/StanfordSpezi.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":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"custom":["spezi.sites.stanford.edu"]}},"created_at":"2025-08-04T22:20:11.000Z","updated_at":"2026-01-22T09:13:03.000Z","dependencies_parsed_at":"2025-08-06T16:31:59.008Z","dependency_job_id":"250cb0ae-a6b4-459d-ba13-388074a7fd4d","html_url":"https://github.com/StanfordSpezi/SpeziConsent","commit_stats":null,"previous_names":["stanfordspezi/speziconsent"],"tags_count":3,"template":false,"template_full_name":"StanfordBDHG/SwiftPackageTemplate","purl":"pkg:github/StanfordSpezi/SpeziConsent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanfordSpezi%2FSpeziConsent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanfordSpezi%2FSpeziConsent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanfordSpezi%2FSpeziConsent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanfordSpezi%2FSpeziConsent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StanfordSpezi","download_url":"https://codeload.github.com/StanfordSpezi/SpeziConsent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanfordSpezi%2FSpeziConsent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29605799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["consent","ios","spezi","stanford"],"created_at":"2025-10-21T08:21:04.949Z","updated_at":"2026-02-19T07:01:37.744Z","avatar_url":"https://github.com/StanfordSpezi.png","language":"Swift","funding_links":["spezi.sites.stanford.edu"],"categories":[],"sub_categories":[],"readme":"\u003c!--\n                  \nThis source file is part of the Stanford Spezi open-source project\n\nSPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)\n\nSPDX-License-Identifier: MIT\n             \n--\u003e\n\n# SpeziConsent\n\n[![Build and Test](https://github.com/StanfordSpezi/SpeziConsent/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/StanfordSpezi/SpeziConsent/actions/workflows/build-and-test.yml)\n[![codecov](https://codecov.io/gh/StanfordSpezi/SpeziConsent/branch/main/graph/badge.svg?token=X7BQYSUKOH)](https://codecov.io/gh/StanfordSpezi/SpeziConsent)\n[![DOI](https://zenodo.org/badge/573230182.svg)](https://zenodo.org/badge/latestdoi/573230182)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FStanfordSpezi%2FSpeziConsent%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/StanfordSpezi/SpeziConsent)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FStanfordSpezi%2FSpeziConsent%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/StanfordSpezi/SpeziConsent)\n\nProvides UI components for consent handling in your app.\n\n\n## Overview\n\nThe SpeziConsent module provides utilities for retrieving consent for e.g. study participation.\n\n\n\u003ctable style=\"width: 80%\"\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\" width=\"33.33333%\"\u003e\n      \u003cimg src=\"Sources/SpeziConsent/SpeziConsent.docc/Resources/Consent1.png#gh-light-mode-only\" alt=\"Screenshot displaying a simple consent form\" width=\"80%\"/\u003e\n      \u003cimg src=\"Sources/SpeziConsent/SpeziConsent.docc/Resources/Consent1~dark.png#gh-dark-mode-only\" alt=\"Screenshot displaying a simple consent form\" width=\"80%\"/\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"33.33333%\"\u003e\n      \u003cimg src=\"Sources/SpeziConsent/SpeziConsent.docc/Resources/Consent2.png#gh-light-mode-only\" alt=\"Screenshot displaying an interactive consent form\" width=\"80%\"/\u003e\n      \u003cimg src=\"Sources/SpeziConsent/SpeziConsent.docc/Resources/Consent2~dark.png#gh-dark-mode-only\" alt=\"Screenshot displaying an interactive consent form\" width=\"80%\"/\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"33.33333%\"\u003e\n      \u003cimg src=\"Sources/SpeziConsent/SpeziConsent.docc/Resources/Consent3.png#gh-light-mode-only\" alt=\"Screenshot displaying an interactive consent form with required responses\" width=\"80%\"/\u003e\n      \u003cimg src=\"Sources/SpeziConsent/SpeziConsent.docc/Resources/Consent3~dark.png#gh-dark-mode-only\" alt=\"Screenshot displaying an interactive consent form with required responses\" width=\"80%\"/\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n      Simple Consent Form\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n      Interactive Consent Form\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n      Interactive Consent Form with Selection Requirements\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n### Onboarding Consent View\n\nThe [`OnboardingConsentView`](https://swiftpackageindex.com/stanfordspezi/speziconsent/documentation/speziconsent/onboardingconsentview) can be used to allow your users to read and agree to a document, e.g., a consent document for a research study or a terms and conditions document for an app. The document can be signed using a family and given name and a hand-drawn signature. The signed consent form can then be exported and shared as a PDF file.\n\nThe following example demonstrates how the [`OnboardingConsentView`](https://swiftpackageindex.com/stanfordspezi/speziconsent/documentation/speziconsent/onboardingconsentview) shown above is constructed by reading a consent form from a markdown file, creating a [`ConsentDocument`](https://swiftpackageindex.com/stanfordspezi/speziconsent/documentation/speziconsent/consentdocument) and passing it to the `OnboardingConsentView`, and  an action that should be performed once the consent has been given (which receives the exported consent form as a PDF), as well as a configuration defining the properties of the exported consent form.\n\nThe following example demonstrates using the  [`OnboardingConsentView`](https://swiftpackageindex.com/stanfordspezi/speziconsent/documentation/speziconsent/onboardingconsentview) to present a consent form to the user as part of an onboarding flow.\nOnce the consent if completed (i.e., the user signed it and filled out all required form elements), the user can continue to the next onboarding step.\nThe view also uses the [`ConsentShareButton`](https://swiftpackageindex.com/stanfordspezi/speziconsent/documentation/speziconsent/consentsharebutton) to allow the user to obtain a PDF-exported copy of their signed consent document. \n\n```swift\nimport SpeziConsent\nimport SpeziViews\nimport SwiftUI\n\nstruct ConsentStep: View {\n    let url: URL\n    \n    @State private var consentDocument: ConsentDocument?\n    @State private var viewState: ViewState = .idle\n    \n    var body: some View {\n        OnboardingConsentView(consentDocument: consentDocument, viewState: $viewState) {\n            // advance your Onboarding flow in response to the user having confirmed a completed consent document\n        }\n        .viewStateAlert(state: $viewState)\n        .toolbar {\n            ToolbarItem(placement: .primaryAction) {\n                // give your user the ability to obtain a PDF version of the consent document they just signed\n                ConsentShareButton(\n                    consentDocument: consentDocument,\n                    viewState: $viewState\n                )\n            }\n        }\n        .task {\n            // load the consent document when the view is first displayed.\n            // this will automatically cause the `OnboardingConsentView` above to update its contents.\n            do {\n                consentDocument = try ConsentDocument(contentsOf: url)\n            } catch {\n                viewState = .error(AnyLocalizedError(error: error))\n            }\n        }\n    }\n}\n```\n\nFor more information, please refer to the [API documentation](https://swiftpackageindex.com/StanfordSpezi/SpeziConsent/documentation).\n\n\n## The Spezi Template Application\n\nThe [Spezi Template Application](https://github.com/StanfordSpezi/SpeziTemplateApplication) provides a great starting point and example using the `SpeziConsent` module.\n\n\n\n## Contributing\n\nContributions to this project are welcome. Please make sure to read the [contribution guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md) and the [contributor covenant code of conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) first.\n\n\n## License\n\nThis project is licensed under the MIT License. See [Licenses](https://github.com/StanfordSpezi/SpeziConsent/tree/main/LICENSES) for more information.\n\n![Spezi Footer](https://raw.githubusercontent.com/StanfordSpezi/.github/main/assets/Footer.png#gh-light-mode-only)\n![Spezi Footer](https://raw.githubusercontent.com/StanfordSpezi/.github/main/assets/Footer~dark.png#gh-dark-mode-only)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstanfordspezi%2Fspeziconsent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstanfordspezi%2Fspeziconsent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstanfordspezi%2Fspeziconsent/lists"}