Update doc for register handler (#151)

This commit is contained in:
Lukasz Ostrowski 2023-01-19 14:17:36 +01:00 committed by GitHub
parent 62a9c2b11f
commit 74e3f40ca5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,6 +61,7 @@ import { VercelAPL } from "./vercel-apl";
export default createAppRegisterHandler({ export default createAppRegisterHandler({
apl: new VercelAPL(), apl: new VercelAPL(),
allowedSaleorUrls: ["https://your-saleor.saleor.cloud/graphql/"], // optional, see options below
}); });
``` ```
@ -69,6 +70,11 @@ Options provided to handler factory
```typescript ```typescript
export type CreateAppRegisterHandlerOptions = { export type CreateAppRegisterHandlerOptions = {
apl: APL; apl: APL;
/**
* Provide your Saleor /graphql/ endpoints (or functions),
* to allow app registration only in allowed Saleor instances.
*/
allowedSaleorUrls?: Array<string | ((saleorApiUrl: string) => boolean)>;
}; };
``` ```
@ -78,4 +84,4 @@ See [APL](./apl.md) for details what is Auth Persistence Layer in Saleor apps
App SDK provides a utility that helps building (async) webhook handlers, so app can react on Saleor events. App SDK provides a utility that helps building (async) webhook handlers, so app can react on Saleor events.
Read about it [here](./saleor-async-webhook.md). Read about it [here](./saleor-async-webhook.md).