This quickstart sample creates a Square client instance with your Square access token and then lists the locations in your account. The sample is based on the Node SDK Quickstart guide.
Install Node - If you don't have Node already installed on your machine.
-
Change into the
quickstart
directory -
copy
.env.example
to.env
and replace with your access tokenSQUARE_ACCESS_TOKEN=yourSandboxAccessToken
-
Install latest version of the square SDK
$ npm install square
-
Run the code
$ npm run start
-
You should see output similar to this in your console
LHJ3ZXJ9RSV8X: Default Test Account, 1600 Pennsylvania Ave NW, Washington
Square Node SDK Guide - details on how to use / configure the Square client.
NPM repository for Square - Where the package files are hosted
Node SDK Source Code - Github repo with sdk source code