{"id":18695351,"url":"https://github.com/smartthingscommunity/smartapp-example-open-close-nodets","last_synced_at":"2026-03-15T01:43:48.038Z","repository":{"id":43394809,"uuid":"318337405","full_name":"SmartThingsCommunity/smartapp-example-open-close-nodets","owner":"SmartThingsCommunity","description":"The Typescript version of the Open/Close example SmartApp.","archived":false,"fork":false,"pushed_at":"2022-10-17T17:30:01.000Z","size":168,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-11-07T11:14:38.878Z","etag":null,"topics":["smartthings-smartapp-example","webhook"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/SmartThingsCommunity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-03T22:33:35.000Z","updated_at":"2024-09-19T00:24:40.000Z","dependencies_parsed_at":"2023-01-20T07:30:22.593Z","dependency_job_id":null,"html_url":"https://github.com/SmartThingsCommunity/smartapp-example-open-close-nodets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartThingsCommunity%2Fsmartapp-example-open-close-nodets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartThingsCommunity%2Fsmartapp-example-open-close-nodets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartThingsCommunity%2Fsmartapp-example-open-close-nodets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartThingsCommunity%2Fsmartapp-example-open-close-nodets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SmartThingsCommunity","download_url":"https://codeload.github.com/SmartThingsCommunity/smartapp-example-open-close-nodets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231580585,"owners_count":18395471,"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":["smartthings-smartapp-example","webhook"],"created_at":"2024-11-07T11:14:40.990Z","updated_at":"2026-03-15T01:43:43.011Z","avatar_url":"https://github.com/SmartThingsCommunity.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Open/Close Lighting Control (TypeScript)\n\nThe following example SmartApp is the equivalent of a simple Rule (if contact sensor opens/closes, turn lights on/off) which is easily achieved via our [Rules API](https://smartthings.developer.samsung.com/docs/rules/overview.html). This simple automation is used here as a brief functional showcase of a SmartApp using the Node SDK, and is not meant to be a good candidate for a SmartApp. Be sure to check if your automation is possible with the Rules API, as it will benefit from speed, stability, and security through future local execution support.\n\n## Start\n\nTo get going quickly with this example, we've provided a few options for hosting below. Follow any one of them to get the app up and accepting requests before moving on to registration instructions.\n\n### Heroku\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n\n[View logs](https://devcenter.heroku.com/articles/logging#log-retrieval-via-the-web-dashboard) in the Heroku dashboard.\n\nClick the **Open app** button in the Heroku dashboard app page to copy the public URL for use in steps below.\n\n### Glitch (no account required)\n\n[![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg)](https://glitch.com/edit/#!/import/github/SmartThingsCommunity/smartapp-example-open-close-nodets)\n\n[View logs](https://support.glitch.com/t/console-log-where-to-find-it/14456) in the Glitch editor.\n\nCopy the [Live Site URL](https://glitch.happyfox.com/kb/article/50-how-do-i-find-the-url-for-my-app/) from Glitch for use in steps below.\n\n### Local\n\nTo make this work locally, we recommend using [ngrok](https://ngrok.com/) to create a globally available URL for fast testing.\n\n`npm install`  \n`npm run build`  \n`npm start`  \n`ngrok http 3001`\n\n## Register\n\nFollow the instructions for [registering a SmartApp](https://smartthings.developer.samsung.com/docs/smartapps/app-registration.html) with the SmartThings platform.\n\n- The following OAuth2 scopes are required.\n    - `r:devices:*` \n    - `x:devices:*` \n\nA `CONFIRMATION request` log should show in the log output of the server once registered. Navigate to this link to [verify your domain ownership](https://smartthings.developer.samsung.com/docs/smartapps/webhook-apps.html#Verify-your-domain-ownership) and enable the app to receive events. **This is required for successful installation.**\n\n## Test\n\nFollow the instructions for [testing a SmartApp](https://smartthings.developer.samsung.com/docs/testing/how-to-test.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartthingscommunity%2Fsmartapp-example-open-close-nodets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartthingscommunity%2Fsmartapp-example-open-close-nodets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartthingscommunity%2Fsmartapp-example-open-close-nodets/lists"}