Skip to content

Commit

Permalink
update sdk and implement vercel kv example
Browse files Browse the repository at this point in the history
  • Loading branch information
lkostrowski committed Dec 17, 2024
1 parent ab116fb commit 796da69
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"pnpm": ">=9.0.0 <10.0.0"
},
"dependencies": {
"@saleor/app-sdk": "0.50.0",
"@saleor/app-sdk": "0.50.3",
"@saleor/macaw-ui": "1.1.10",
"@urql/exchange-auth": "^1.0.0",
"@vitejs/plugin-react": "4.2.1",
Expand Down
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/saleor-app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { SaleorApp } from "@saleor/app-sdk/saleor-app";
import { APL, FileAPL, UpstashAPL } from "@saleor/app-sdk/APL";
import { _experimental_VercelKvApl } from "@saleor/app-sdk/APL/vercel-kv";

/**
* By default auth data are stored in the `.auth-data.json` (FileAPL).
Expand All @@ -10,6 +11,17 @@ import { APL, FileAPL, UpstashAPL } from "@saleor/app-sdk/APL";
*/
export let apl: APL;
switch (process.env.APL) {
case "vercel-kv":
/**
* Following envs are required
*
* "KV_URL",
* "KV_REST_API_URL",
* "KV_REST_API_TOKEN",
* "KV_REST_API_READ_ONLY_TOKEN",
* "KV_STORAGE_NAMESPACE",
*/
apl = new _experimental_VercelKvApl();
case "upstash":
// Require `UPSTASH_URL` and `UPSTASH_TOKEN` environment variables
apl = new UpstashAPL();
Expand Down

0 comments on commit 796da69

Please sign in to comment.