# SmartThings CoreSDK Javascript

**URL:** <https://community.smartthings.com/t/smartthings-coresdk-javascript/194663>\
**Category:** Tutorials\
**Tags:** tutorial\
**Created:** [May 20, 2020, 5:41am UTC](https://community.smartthings.com/t/smartthings-coresdk-javascript/194663 "2020-05-20T05:41:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jody.albritton](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jody.albritton/32/220661_2.png) [@jody.albritton](https://community.smartthings.com/u/jody.albritton)\
**Post date:** [May 20, 2020, 5:41am UTC](https://community.smartthings.com/t/smartthings-coresdk-javascript/194663/1 "2020-05-20T05:41:41Z")

</div>

# Getting Started With CoreSDK JS

The SmartThings Core SDK is a wrapper designed to simplify the use of the [SmartThings REST API](https://developer.smartthings.com/docs/api/public) 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: [GitHub - SmartThingsCommunity/smartthings-core-sdk: SDK for calling the SmartThings API from JavaScript and TypeScript applications](https://github.com/SmartThingsCommunity/smartthings-core-sdk)  
Glitch to Remix: [Coresdk Demo](https://glitch.com/~coresdk-demo)  
PAT Token Page [SmartThings. Add a little smartness to your things.](https://account.smartthings.com/tokens)

YouTube Video

[![](https://global.discourse-cdn.com/smartthings/original/3X/5/c/5cdc24c906a9b2e4776abb7115e0840f4d2a410b.jpeg "CoreSDK Tutorial") ](https://www.youtube.com/watch?v=qCG40ykohaI)

Now Try This:

> [@Simple SmartApp Tutorial (SmartApp SDK)](https://community.smartthings.com/t/simple-smartapp-tutorial-smartapp-sdk/194664):
>
> Getting Started with a Simple SmartApp using the new SmartApp SDK This SDK builds on the CoreSDK and provides kick start for SmartApp development. The SmartApp SDK reduces the amount of code necessary to write a SmartApp using the new platform and API. The SmartApp SDK supports both Webhook and AWS Lamda deployment, but this tutorial will focus on the deploying a webhook SmartApp using Glitch. Maybe Try this first: [https://community.smartthings.com/t/smartthings-coresdk-javascript/194663](https://community.smartthings.com/t/smartthings-coresdk-javascript/194663)Prerequisites Samsung Account Developer Workspace Account Github or Glitch Account One Contact Sensor One or more Light Devices Guide I suggest having all of the required accounts created before getting started. You will need a location prepared with at least one contact sensor and one or more light …

---

<div class="post-metadata">

**Author:** ![jody.albritton](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jody.albritton/32/220661_2.png) [@jody.albritton](https://community.smartthings.com/u/jody.albritton)\
**Post date:** [May 23, 2020, 1:35am UTC](https://community.smartthings.com/t/smartthings-coresdk-javascript/194663/2 "2020-05-23T01:35:18Z")

</div>

Pinned on May 23, 2020, 1:35am UTC



---

<div class="post-metadata">

**Author:** ![jody.albritton](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jody.albritton/32/220661_2.png) [@jody.albritton](https://community.smartthings.com/u/jody.albritton)\
**Post date:** [May 23, 2020, 8:02pm UTC](https://community.smartthings.com/t/smartthings-coresdk-javascript/194663/3 "2020-05-23T20:02:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Corey\_Murnaghan](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/corey_murnaghan/32/89093_2.png) [@Corey\_Murnaghan](https://community.smartthings.com/u/Corey_Murnaghan)\
**Post date:** [May 25, 2020, 1:27pm UTC](https://community.smartthings.com/t/smartthings-coresdk-javascript/194663/4 "2020-05-25T13:27:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jody.albritton](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jody.albritton/32/220661_2.png) [@jody.albritton](https://community.smartthings.com/u/jody.albritton)\
**Post date:** [May 25, 2020, 1:30pm UTC](https://community.smartthings.com/t/smartthings-coresdk-javascript/194663/5 "2020-05-25T13:30:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jody.albritton](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jody.albritton/32/220661_2.png) [@jody.albritton](https://community.smartthings.com/u/jody.albritton)\
**Post date:** [May 25, 2020, 1:36pm UTC](https://community.smartthings.com/t/smartthings-coresdk-javascript/194663/6 "2020-05-25T13:36:38Z")

</div>

> [@Corey\_Murnaghan](#):
>
> Your Glitch page doesn’t show the devices, just says “loading devices…”?

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.

---

<div class="post-metadata">

**Author:** ![Corey\_Murnaghan](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/corey_murnaghan/32/89093_2.png) [@Corey\_Murnaghan](https://community.smartthings.com/u/Corey_Murnaghan)\
**Post date:** [May 25, 2020, 1:39pm UTC](https://community.smartthings.com/t/smartthings-coresdk-javascript/194663/7 "2020-05-25T13:39:49Z")

</div>

Understood and thanks!

---

<div class="post-metadata">

**Author:** ![paullmullen](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@paullmullen](https://community.smartthings.com/u/paullmullen)\
**Post date:** [August 22, 2020, 2:24am UTC](https://community.smartthings.com/t/smartthings-coresdk-javascript/194663/8 "2020-08-22T02:24:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nayelyz](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@nayelyz](https://community.smartthings.com/u/nayelyz)\
**Post date:** [August 24, 2020, 4:35pm UTC](https://community.smartthings.com/t/smartthings-coresdk-javascript/194663/9 "2020-08-24T16:35:50Z")

</div>

Hello @paullmullen,

The development environment shown in the videotutorial is [Glitch](https://glitch.com/), 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](https://docs.npmjs.com/specifying-dependencies-and-devdependencies-in-a-package-json-file) in the package.json file.  
Now that you downloaded the Core SDK repository, you can go through the structure to see the different [endpoints](https://github.com/SmartThingsCommunity/smartthings-core-sdk/tree/master/src/endpoint) and their functions. All them are included in your web application once you add the line `const {SmartThingsClient} = require('@smartthings/core-sdk')`.

---

<div class="post-metadata">

**Author:** ![paullmullen](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@paullmullen](https://community.smartthings.com/u/paullmullen)\
**Post date:** [September 7, 2020, 11:34pm UTC](https://community.smartthings.com/t/smartthings-coresdk-javascript/194663/10 "2020-09-07T23:34:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![robross0606](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/robross0606/32/95236_2.png) [@robross0606](https://community.smartthings.com/u/robross0606)\
**Post date:** [September 11, 2020, 12:12am UTC](https://community.smartthings.com/t/smartthings-coresdk-javascript/194663/11 "2020-09-11T00:12:01Z")

</div>

> [@paullmullen](#):
>
> 1. The SmartThings IDE (device handlers, groovey, etc) is unchanged and integrating new hub connected devices is pretty much as it was.

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](https://community.smartthings.com/t/announcement-changes-to-our-legacy-smartthings-platform/197958)
