Introducing the Adobe Photoshop API SDK for Node.js Developers

Good news for our Node.js developers using the Photoshop API, this week we’ve released an early version of a Node.js SDK on our GitHub organization: https://github.com/adobe/adobe-photoshop-api-sdk. While this does not replace our REST APIs of course, for developers using Node.js, this SDK can provide a simpler method of interacting with the platform. Let’s take a quick look at what the SDK currently provides.
Before you begin
Before taking the SDK for a spin, you’ll first want to grab your credentials. If you don’t have them yet, sign up and generate them. As always, be sure to keep them in a safe place and never commit credentials to a repository. As part of the configuration process, the SDK has you edit a file, config.js
, to include your credentials and you will also want to place a copy of your private key in the same directory.
The samples in the SDK currently make use of Amazon S3, so if you don’t already have an AWS account, you’ll want to set one up and then create an S3 bucket for testing. The SDK readme will walk you through setting up the AWS CLI locally and ensuring that the Photoshop SDK will be able to write to your particular bucket. As a reminder, the Photoshop API as a whole does not require S3 and lets you use multiple different cloud providers (or even your own server) for reading and writing files. The AWS S3 requirement is just for testing out the sample scripts.
Samples
Speaking of sample scripts, in the src/sample
folder you will find multiple different examples of how to work with the SDK to test out various Photoshop API features. You'll also find an example of performing batch operations as well. Here's a great example that demonstrates the cutout feature:
Let’s break this down and call out the important bits. First, we initialize the SDK:
Currently, the SDK isn’t in NPM, but we plan on migrating it there in the future.
Next, we define our input and output. Note that this consists of setting the URL as well as a storage and file type:
In this sample, the input is simply a publicly available image. The output will use our configured S3 bucket. And finally, here’s the entire operation wrapped up in one simple call:
Nice and short, right? Obviously, more complex operations will require additional code, so for example, here’s an example from the edit photo sample showing how to pass options:
As you can see in both samples, both the creation of the job and polling for completion are all handled for you, making using the APIs even simpler.
Next steps
If all of this sounds like something that would help you use our APIs even more, head over to the repository and give it a spin yourself. You can help by filing issues with any bugs or suggestions you may have. Finally, hit up our forums with any questions you may have!