SmartThings CoreSDK Javascript

Getting Started With CoreSDK JS

The SmartThings Core SDK is a wrapper designed to simplify the use of the SmartThings REST API from JavaScript and TypeScript applications. This is the very first release of this SDK and should be considered a work in progress. Changes may still be made that are not backwardly compatible.

Prerequisites

  • Samsung Account
  • SmartThings Account with at least one device
  • Github Account or Glitch Account

Guide

In this tutorial we will use Glitch but you should be able to follow along with any express enabled node environment.

Links

Github: https://github.com/SmartThingsCommunity/smartthings-core-sdk
Glitch to Remix: https://glitch.com/~coresdk-demo
PAT Token Page https://account.smartthings.com/tokens

YouTube Video

Now Try This:

11 Likes

Will be working on a part two for this over the weekend to actuate devices. Anything else you would like to see?

2 Likes

Your Glitch page doesn’t show the devices, just says “loading devices…”?

You need to watch the video above. It will only show loading devices until you add your own PAT token.

  1. Remix the project
  2. Put you own PAT token in the .env file
1 Like

Another note:

This project is for learning how to create an application using the CoreSDK. The token is tied to your personal ST account so keep things private.

1 Like

Understood and thanks!

1 Like

I’m transitioning over from the ST Classic IDE. I’m excited about exploring the new development world, but I confess that I’m lost by a lot of new things at once. I’m new to node.js, new to Glitch, etc. I can follow the recipes to download the dev tools, but I could really use a tutorial that describes how it fits together… not just click-here-then-do-this.

Also, I downloaded node.js, cloned the Git repository, etc. But when I fire up node.js, I just get a command line window… not the - apparently - browser based develpment environment that is in this video tutorial.

I’m not a newbie to development in a broad sense, but I’m new to nearly every one of these tools, and I could use some basic orientation to get me off the ground.

Thanks,

Paul

1 Like

Hello @paullmullen,

The development environment shown in the videotutorial is Glitch, a tool to create web applications easily that allows us to run them without having to install any software. To create a copy of the project, you can do the following:

  1. Go to the link of the demo project on Glitch.
  2. In the upper right corner, click on “remix to edit”

Another option is, to download Node JS, and use it through another IDE, such as Visual Studio Code; you can copy the same code and It will work after installing the corresponding dependencies in the package.json file.
Now that you downloaded the Core SDK repository, you can go through the structure to see the different endpoints and their functions. All them are included in your web application once you add the line const {SmartThingsClient} = require('@smartthings/core-sdk').

Thanks… Here’s what I have finally inferred:

  1. The SmartThings IDE (device handlers, groovey, etc) is unchanged and integrating new hub connected devices is pretty much as it was.

  2. Now there’s a whole new world of well documented ST APIs to access ST from apps outside of the device-level development world. This is where all the new stuff comes in. So for instance, if we’re not psyched with ActionTiles, we could write our own cloud-based app, using these APIs to make our ActionTiles++, or whatever.

I don’t think this one is quite right. It is true right now, but things are changing in phases. I believe Phase 3 will remove the Groovy-based SmartThings IDE by some time next year.

Reference: Announcement | Changes to our Legacy SmartThings Platform