diff --git a/types/login-with-amazon-sdk-browser/index.d.ts b/types/login-with-amazon-sdk-browser/index.d.ts index 10fab8dfcb..56dfac1a4a 100644 --- a/types/login-with-amazon-sdk-browser/index.d.ts +++ b/types/login-with-amazon-sdk-browser/index.d.ts @@ -49,8 +49,15 @@ interface AuthorizeOptions { * */ state?: string; + scope_data?: AuthorizeScopeData; } +type AuthorizeScopeData = { + [scope in AuthorizationScopeOptions]?: { + essential: boolean; + } +}; + /** * * Accepted values for `scope` member of `authorize` options. @@ -213,6 +220,10 @@ declare namespace amazon { options: CodeAuthorizeOptions, next?: string | NextCallback ): CodeRequest; + function authorize( + options: AuthorizeOptions, + next?: string | NextCallback + ): AuthorizeRequest; /** * Retrieves the customer profile and passes it to a callback function. diff --git a/types/login-with-amazon-sdk-browser/login-with-amazon-sdk-browser-tests.ts b/types/login-with-amazon-sdk-browser/login-with-amazon-sdk-browser-tests.ts index b89e775877..f413589ae9 100644 --- a/types/login-with-amazon-sdk-browser/login-with-amazon-sdk-browser-tests.ts +++ b/types/login-with-amazon-sdk-browser/login-with-amazon-sdk-browser-tests.ts @@ -28,6 +28,9 @@ const request = amazon.Login.authorize({ response_type: "code", state: "my-state", scope: "profile", + scope_data: { + postal_code: { essential: true }, + }, }); request.onComplete("my://redirect.url");