Socket
Socket
Sign inDemoInstall

@adobe/adobe-photoshop-api-sdk

Package Overview
Dependencies
7
Maintainers
21
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @adobe/adobe-photoshop-api-sdk

Adobe Photoshop API SDK


Version published
Weekly downloads
3
Maintainers
21
Created
Weekly downloads
 

Readme

Source

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/)

FAQs

Last updated on 07 Jun 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc