SDK for building Saleor Apps.
Supports Saleor version 3.21+
main branch is a current, latest branch.v[0-9]+.x (like v1.x, v0.x`) are release branchesmain branch and contain changesets (run npx changeset). Once changeset is merged to main, the release PR is opened. After the release PR is merged, the version is being pushed to NPM and changesets are prunedmain (including changeset) should be also ported to release branch (e.g. v0.x). Release branch will also detect changes and open release PRv2.x from v1.x):
v1.x branch)main with major change, which will start counting next main releases as 2.x.xPRs can be pushed to NPM by adding label to PR release dev tag. Workflow will run and print version that has been released.
npm i @saleor/app-sdk
You can find the documentation here.
The SDK has several optional peer dependencies. Install only what you need based on which entry points you use:
| Entry Point | Required Peer Dependencies |
|---|---|
@saleor/app-sdk/app-bridge | react, react-dom |
@saleor/app-sdk/app-bridge/next | react, react-dom, next |
@saleor/app-sdk/handlers/next | next, graphql |
@saleor/app-sdk/handlers/next-app-router | next, graphql |
@saleor/app-sdk/handlers/fetch-api | graphql |
@saleor/app-sdk/handlers/aws-lambda | graphql |
@saleor/app-sdk/settings-manager | - |
@saleor/app-sdk/APL | - |
@saleor/app-sdk/APL/env | - |
@saleor/app-sdk/APL/file | - |
@saleor/app-sdk/APL/upstash | - |
@saleor/app-sdk/APL/saleor-cloud | - |
@saleor/app-sdk/APL/redis | redis |
@saleor/app-sdk/APL/vercel-kv | @vercel/kv |
@saleor/app-sdk/APL/dynamodb | @aws-sdk/client-dynamodb, @aws-sdk/lib-dynamodb, dynamodb-toolbox |
* EncryptedMetadataManager uses Node.js crypto by default. For browser usage, provide custom encryptionMethod and decryptionMethod, or use MetadataManager without encryption.
If you would like to develop the SDK and test it with existing project:
pnpm watch
Now any code change will trigger build operation automatically.
pnpm add ../saleor-app-sdk/dist
As path to your local copy of the App SDK may be different, adjust it accordingly.
Before committing the code, Git pre-hooks will check staged changes for following the code styles. If you would like to format the code by yourself, run the command:
pnpm lint
To run the integration tests (e.g., Redis APL tests), follow these steps:
docker run --name saleor-app-sdk-redis -p 6379:6379 -d redis:7-alpine
pnpm test:integration
docker stop saleor-app-sdk-redis
docker rm saleor-app-sdk-redis
Note: If your Redis instance is running on a different host or port, you can set the REDIS_URL environment variable:
REDIS_URL=redis://custom-host:6379 pnpm test:integration
374 followers · starred Oct 2022
82 followers · starred Oct 2022
306 followers · starred Oct 2022
15 followers · starred Oct 2022
SDK for building Saleor Apps.
Supports Saleor version 3.21+
main branch is a current, latest branch.v[0-9]+.x (like v1.x, v0.x`) are release branchesmain branch and contain changesets (run npx changeset). Once changeset is merged to main, the release PR is opened. After the release PR is merged, the version is being pushed to NPM and changesets are prunedmain (including changeset) should be also ported to release branch (e.g. v0.x). Release branch will also detect changes and open release PRv2.x from v1.x):
v1.x branch)main with major change, which will start counting next main releases as 2.x.xPRs can be pushed to NPM by adding label to PR release dev tag. Workflow will run and print version that has been released.
npm i @saleor/app-sdk
You can find the documentation here.
The SDK has several optional peer dependencies. Install only what you need based on which entry points you use:
| Entry Point | Required Peer Dependencies |
|---|---|
@saleor/app-sdk/app-bridge | react, react-dom |
@saleor/app-sdk/app-bridge/next | react, react-dom, next |
@saleor/app-sdk/handlers/next | next, graphql |
@saleor/app-sdk/handlers/next-app-router | next, graphql |
@saleor/app-sdk/handlers/fetch-api | graphql |
@saleor/app-sdk/handlers/aws-lambda | graphql |
@saleor/app-sdk/settings-manager | - |
@saleor/app-sdk/APL | - |
@saleor/app-sdk/APL/env | - |
@saleor/app-sdk/APL/file | - |
@saleor/app-sdk/APL/upstash | - |
@saleor/app-sdk/APL/saleor-cloud | - |
@saleor/app-sdk/APL/redis | redis |
@saleor/app-sdk/APL/vercel-kv | @vercel/kv |
@saleor/app-sdk/APL/dynamodb | @aws-sdk/client-dynamodb, @aws-sdk/lib-dynamodb, dynamodb-toolbox |
* EncryptedMetadataManager uses Node.js crypto by default. For browser usage, provide custom encryptionMethod and decryptionMethod, or use MetadataManager without encryption.
If you would like to develop the SDK and test it with existing project:
pnpm watch
Now any code change will trigger build operation automatically.
pnpm add ../saleor-app-sdk/dist
As path to your local copy of the App SDK may be different, adjust it accordingly.
Before committing the code, Git pre-hooks will check staged changes for following the code styles. If you would like to format the code by yourself, run the command:
pnpm lint
To run the integration tests (e.g., Redis APL tests), follow these steps:
docker run --name saleor-app-sdk-redis -p 6379:6379 -d redis:7-alpine
pnpm test:integration
docker stop saleor-app-sdk-redis
docker rm saleor-app-sdk-redis
Note: If your Redis instance is running on a different host or port, you can set the REDIS_URL environment variable:
REDIS_URL=redis://custom-host:6379 pnpm test:integration
374 followers · starred Oct 2022
82 followers · starred Oct 2022
306 followers · starred Oct 2022
15 followers · starred Oct 2022