{"id":26822668,"url":"https://github.com/dylanpieper/shinysurveyjs","last_synced_at":"2025-03-30T08:20:12.336Z","repository":{"id":278466538,"uuid":"910160094","full_name":"dylanpieper/shinysurveyjs","owner":"dylanpieper","description":"Create and Deploy Survey Applications","archived":false,"fork":false,"pushed_at":"2025-03-20T20:45:07.000Z","size":2453,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T22:00:56.985Z","etag":null,"topics":["package","r","shiny","surveyjs"],"latest_commit_sha":null,"homepage":"https://dylanpieper.github.io/shinysurveyjs/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dylanpieper.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":"2024-12-30T16:33:49.000Z","updated_at":"2025-03-20T20:43:06.000Z","dependencies_parsed_at":"2025-03-20T21:48:25.011Z","dependency_job_id":"82a74c76-9994-4d38-b562-893a600ce39a","html_url":"https://github.com/dylanpieper/shinysurveyjs","commit_stats":null,"previous_names":["dylanpieper/shinysurveyjs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanpieper%2Fshinysurveyjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanpieper%2Fshinysurveyjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanpieper%2Fshinysurveyjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanpieper%2Fshinysurveyjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dylanpieper","download_url":"https://codeload.github.com/dylanpieper/shinysurveyjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246291598,"owners_count":20753905,"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":["package","r","shiny","surveyjs"],"created_at":"2025-03-30T08:20:11.416Z","updated_at":"2025-03-30T08:20:12.312Z","avatar_url":"https://github.com/dylanpieper.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shinysurveyjs\u003cimg src=\"man/figures/SSJS-Hex.svg\" alt=\"A hexagonal logo for the R package shinysurveyjs, styled in the traditional R package hexagon sticker format\" align=\"right\" width=\"150\" height=\"150\"/\u003e\n\nIntegrate [SurveyJS](#0) with [Shiny](#0) to interface with a [PostgreSQL](#0) database and create dynamic survey experiences.\n\n## SurveyJS\n\nSurveyJS is a JavaScript library that streamlines the creation of survey applications through a [jQuery](https://www.npmjs.com/package/survey-jquery) architecture. The library offers a [visual editor](https://surveyjs.io/create-free-survey) to design complex surveys through a drag-and-drop interface and generate a JSON object.\n\nThe JSON defines every survey element, including a title, description, logo, and page layout as well as progress indicators, question types, validation rules, logic flows, visibility controls, and text piping. The library's strength lies in its backend-agnostic approach, supporting integration with any server technology.\n\nIn R \u0026 Shiny applications, developers can parse the JSON either as a raw text string or by converting a list to JSON format, which then gets passed to the front-end. LLMs are great tool for converting a JSON object to a list.\n\n## Basic Features\n\n-   Store data in a PostgreSQL database, including timing metadata (duration to load, duration to complete, duration to save, date created, and date updated) and tracking metadata (Shiny session ID and IP address)\n\n-   All of the database tables that the app writes to are automatically created if they don't already exist.\n\n-   Automatically save survey progress as cookies and resume later\n\n-   Change the theme, primary color, and contrast mode (light or dark)\n\n## Advanced Features\n\n-   Dynamically populate field choices (i.e., response options) from a database table and create dependent inputs (e.g., select a package name and filter available versions) with support for tracking via URL parameters (e.g., referral source; see [vignette](articles/dynamic_field_config.html))\n\n-   Log app messages, warnings, and errors in a database table\n\n-   Use [future](https://future.futureverse.org/) to update tables without interrupting the survey\n\n## Installation\n\n``` r\npak::pkg_install(\"dylanpieper/shinysurveyjs\")\n```\n\n## Basic Usage\n\nImagine I want to develop a feedback survey for my package.\n\n### Single Survey\n\nLet's define the survey as a list and then run the `survey()` function. I'm using [Supabase](https://supabase.com/) for my PostgreSQL database.\n\n#### JSON\n\n``` r\nsurvey \u003c- list(\n  title = \"R Package Feedback\",\n  pages = list(\n    list(\n      name = \"page1\",\n      elements = list(\n        list(\n          type = \"matrix\",\n          name = \"rating\",\n          title = \"Please rate the shinysurveyjs 📦:\",\n          isRequired = TRUE,\n          columns = list(\n            list(value = \"1\", text = \"Very Bad\"),\n            list(value = \"2\", text = \"Bad\"),\n            list(value = \"3\", text = \"Neutral\"),\n            list(value = \"4\", text = \"Good\"),\n            list(value = \"5\", text = \"Very Good\")\n          ),\n          rows = list(\n            list(value = \"UI\", text = \"UI Design\"),\n            list(value = \"Server\", text = \"Server Functionality\")\n          )\n        ),\n        list(\n          type = \"comment\",\n          name = \"feedback\",\n          title = \"Any other feedback?\",\n          isRequired = TRUE\n        )\n      )\n    )\n  )\n)\n\nshinysurveyjs::survey(\n  list = survey,\n  db_config = list(\n    host = Sys.getenv(\"HOST\"),                # aws-0-us-east-2.pooler.supabase.com\n    port = as.numeric(Sys.getenv(\"PORT\")),    # 5432\n    db_name = Sys.getenv(\"DB_NAME\"),          # postgres\n    user = Sys.getenv(\"USER\"),                # username\n    password = Sys.getenv(\"PASSWORD\"),        # password\n    write_table = Sys.getenv(\"WRITE_TABLE\"),  # survey_package_feedback\n    log_table = Sys.getenv(\"LOG_TABLE\")       # survey_app_logs\n  )\n)\n```\n\nBy default, the database configuration looks for environmental variables (e.g., `Sys.getenv(\"PASSWORD\")`) that can be loaded from the `.Renviron` or your preferred method for handling environmental variables.\n\nCheck out a more complex [gist of this form with expressions and text piping](https://gist.github.com/dylanpieper/c570dba08f03daa25445dfe5aea9ab15).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylanpieper%2Fshinysurveyjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdylanpieper%2Fshinysurveyjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylanpieper%2Fshinysurveyjs/lists"}