{"id":18695361,"url":"https://github.com/smartthingscommunity/smartapp-example-no-devices-nodejs-lambda","last_synced_at":"2025-04-12T07:25:40.715Z","repository":{"id":43874315,"uuid":"329414977","full_name":"SmartThingsCommunity/smartapp-example-no-devices-nodejs-lambda","owner":"SmartThingsCommunity","description":"Give Lambda SmartApps a try without any physical devices.","archived":false,"fork":false,"pushed_at":"2022-10-17T17:25:58.000Z","size":201,"stargazers_count":5,"open_issues_count":1,"forks_count":5,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-26T02:42:40.314Z","etag":null,"topics":["aws-lambda","smartthings-smartapp-example"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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":"2021-01-13T19:47:49.000Z","updated_at":"2024-09-19T00:24:35.000Z","dependencies_parsed_at":"2023-01-20T07:30:16.907Z","dependency_job_id":null,"html_url":"https://github.com/SmartThingsCommunity/smartapp-example-no-devices-nodejs-lambda","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-no-devices-nodejs-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartThingsCommunity%2Fsmartapp-example-no-devices-nodejs-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartThingsCommunity%2Fsmartapp-example-no-devices-nodejs-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartThingsCommunity%2Fsmartapp-example-no-devices-nodejs-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SmartThingsCommunity","download_url":"https://codeload.github.com/SmartThingsCommunity/smartapp-example-no-devices-nodejs-lambda/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248532388,"owners_count":21119900,"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":["aws-lambda","smartthings-smartapp-example"],"created_at":"2024-11-07T11:14:42.597Z","updated_at":"2025-04-12T07:25:40.687Z","avatar_url":"https://github.com/SmartThingsCommunity.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Get started with Lambda SmartApps\n\nThis example allows you to test a Lambda SmartApp without requiring any physical devices. It can also be invoked locally using [Serverless CLI](https://www.serverless.com/framework/docs/providers/aws/cli-reference/) without requiring any accounts or deployments.\n\n## Invoke Locally\n\nTest locally using [serverless invoke local](https://www.serverless.com/framework/docs/providers/aws/cli-reference/invoke-local/) by passing in example SmartThings event payload data. This will enable you to exercise the various event handlers in the SmartApp without needing to deploy the changes.\n\n### Examples\n\nFirst, `npm install` to pull in serverless.\n\n#### Installed event handler\n\n`npx serverless invoke local -f smartapp -p payloads/install.json`\n\n#### Scheduled event handler\n\n`npx serverless invoke local -f smartapp -p payloads/schedule.json`\n\nSee [payloads](payloads) for more event data that conforms to the SmartThings SmartApp API.\n\n## Run in AWS\n\n### Prerequisites\n\n- An [AWS](https://www.serverless.com/framework/docs/providers/aws/guide/credentials/) account (free tier is fine).\n- A [Samsung account](https://account.samsung.com/membership/index.do) and the SmartThings mobile application.\n- A [Developer Workspace](https://smartthings.developer.samsung.com/workspace/) account.\n\n### Deploy\n\n1. Install the dependencies for this app: `npm install`.\n\n1. Follow the instructions to [setup AWS credentials](https://www.serverless.com/framework/docs/providers/aws/guide/credentials/) for serverless.\n\n1. Deploy the Lambda function: `npx serverless deploy`.\n\n1. Follow the steps to grant SmartThings [permission to execute your Lambda function](https://smartthings.developer.samsung.com/docs/smartapps/aws-lambda.html). **This is required for successful registration.**\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\t- `r:locations:*`\n\n### Test\n\nFollow the instructions for [testing a SmartApp](https://smartthings.developer.samsung.com/docs/testing/how-to-test.html).\n\nOnce installed, the app should schedule itself to say hello every minute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartthingscommunity%2Fsmartapp-example-no-devices-nodejs-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartthingscommunity%2Fsmartapp-example-no-devices-nodejs-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartthingscommunity%2Fsmartapp-example-no-devices-nodejs-lambda/lists"}