npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@adobe/adobe-photoshop-api-sdk

v1.1.1

Published

Adobe Photoshop API SDK

Downloads

14

Readme

Adobe Photoshop API SDK Beta

To Get Started

You’ll need to have:

  1. Access to Photoshop API credentials. If you don't already have any you can create them by signing up here.
    1. Enter your project name and click on “Create credentials” and keep an eye out for the config.zip that will automatically download.
  2. Access to AWS
    1. If you don't already have an AWS account you can create one here.
    2. Once your account is created create an S3 bucket by going here.
    3. Click on “Create bucket” and name your bucket.

Create AWS access key

  1. If you do not have an AWS access key already you will need to create one by going to AWS IAM console.
  2. Click on your user name.
  3. Click on "Security credentials"
  4. Scroll down the page and click on "Create access key"
  5. Select "Command Line Interface" and click "Next"
  6. Enter a name for your access key and click on “Create access key”
  7. Copy and paste the “Secret access key” and store it in a safe place. You will need it in the next step. We recommend downloading the .csv file and storing it in a safe location as the Secret will not be accessible after you leave the screen

Set up AWS CLI

  1. Install AWS CLI
  2. Configure AWS CLI by running the following command in your terminal aws configure
  3. If you already have an aws profile you would need to run aws configure [--profile profile-name]
  4. You will need to enter the following information
  5. Add your AWS access key
  6. AWS Secret access key
  7. Default region (choose a region closest to you for faster processing)
  8. Default output format: NONE
  9. Test AWS CLI: Run the following command aws s3 ls to verify everything is configured correctly. The command should return a list of your available buckets.

Download this project

  1. Open your terminal
  2. Run git clone https://github.com/adobe/adobe-photoshop-api-sdk to download the SDK.
  3. Change directory into adobe-photoshop-api-sdk
  4. Run npm install to install node modules
  5. Unzip the config.zip file that downloaded at the start and save private.key as config/private.key in this project
  6. Open config/adobe-template.js, fill in the information, and save config/adobe.js
    1. Everything you need to fill out the template can be found in your console
  7. Open config/aws-template.js, fill in the information, and save config/aws.js
    1. See README to find where to get those information.
// Adobe Photoshop API Configuration
// https://developer.adobe.com/console/projects -> project -> Service Account (JWT)
const adobeConfig = {
  clientId: "",
  clientSecret: "",
  technicalAccountId: "",
  orgId: "",
  metaScopes: ["ent_ccas_sdk"],
};
// AWS Configuration
// https://aws.amazon.com/console/
const awsConfig = {
  region: "", // us-east-1
  bucketName: "" // aws s3 bucket name
}

Sample Script

Run a sample script (src/sample/psapi/...)

  1. Run a sample
node src/sample/psapi/01_createCutout.js
  1. Find your output file in your S3 storage, output directory (ex: s3://<awsConfig.bucketName>/output/...)

Run a sample scrip for a batch job (src/sample/batch_script/...)

  1. Store multiple JPEG files in your S3 storage (ex: s3://<awsConfig.bucketName>/input/...) or modify input/output directories in the sample script.
// -------------------------------------------------
// Enter your parameters
// -------------------------------------------------
const inputDir = 'input/' //your input directory in S3 bucket (ex: s3://<awsConfig.bucketName>/input)
const outputDir = 'output' //your output directory in S3 bucket (ex: s3://<awsConfig.bucketName>/input/output)

const listObjectsInputRequest = { //URI Request Parameters
  // Add more request as you like.  see https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html for more details
  Bucket: awsConfig.bucketName, //Bucket name to list.
  Prefix: inputDir, // Keys that begin with the indicated prefix.
  MaxKeys: 5 // Sets the maximum number of keys returned in the response. By default the action returns up to 1,000 key names.
};
// -------------------------------------------------
  1. Run a sample
node src/sample/batch_job/01_createCutout_batch.js
  1. Find your output files in your S3 storage, output directory (ex: s3://<awsConfig.bucketName>/input/output/...)
  • You can also use AWS CLI to sync files from your S3 storage into your local machine (ex: aws s3 sync s3://<awsConfig.bucketName>/input/output/ /Users/<username>/Desktop/output/)

Links