Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<amp-viewer-assistance> extension #15195

Closed
dreamofabear opened this issue May 10, 2018 · 5 comments
Closed

<amp-viewer-assistance> extension #15195

dreamofabear opened this issue May 10, 2018 · 5 comments
Labels
INTENT TO IMPLEMENT Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code P2: Soon Type: Feature Request WG: viewers

Comments

@dreamofabear
Copy link

Motivation

AMP has two properties that make it an attractive solution for distributed commerce:

  1. It's safe to embed an AMP page in another property.
  2. There is a clear privacy boundary between the AMP page and the AMP viewer.

The proposed amp-viewer-assistance extension standardizes certain messaging between AMP pages and AMP viewers so that developers can optimize their transaction flows for the platforms in which those flows will be embedded. For example:

  • If users of a platform are signed in, then the platform already knows the user's name, contacts, payment method, calendar, etc.
  • A merchant's AMP page can ask the platform's AMP viewer for that personal information. The viewer takes care of prompting the user to share that information.
  • This streamlines the transaction flow because the user doesn't have to re-type information. They can simply reuse information they've previously provided to the platform.
  • The same AMP page can work on other platforms that have their own viewer implementations.

Requirements

  • Support viewer facilitation of transactional user flows for identity, form input and order completion.
  • Support platform-agnostic configurability.

Proposed design

Platform configuration

Different platforms may require different metadata for these platform-optimized AMP pages. That is done using the following <script> tag:

<script id="amp-viewer-assistance" type="application/json">
{
  "platformA": {
    "foo": 123,
    "bar": 456,
  },
  "platformB": {
    ...
  }
}
</script>

The amp-viewer-assistance extension sends this JSON object to the viewer on page load.

Identity facilitation

In order to help users quickly authenticate and/or create an account with the AMP page, the amp-viewer-assistance extension will support identity flows.

The AMP page can prompt the user to sign in by calling the amp-viewer-assistance.signIn action. This will prompt the viewer to show an SSO UI (e.g. a dialog) and, if the user completes the sign in, a signedIn event will be triggered on the amp-viewer-assistance script tag.

If the user comes back to an AMP page from that same project at a later time, the user will be automatically logged in. The AMP page can access the identity token through the IDENTITY_TOKEN URL substitution variable.

Form input assistance

Autofill is another useful feature of platform-optimized AMP pages. The amp-viewer-assistance extension facilitates this by watching for events on the form fields and sending messages to the viewer, so that the viewer can suggest values for that field.

Order completion trigger

If a user wants to make a purchase in an AMP page, it can send the hosting platform information about that order by triggering the amp-viewer-assistance.actionCompleted(…) action.

@dreamofabear dreamofabear added the INTENT TO IMPLEMENT Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code label May 10, 2018
@ampprojectbot ampprojectbot added this to the Pending Triage milestone Jun 5, 2018
@ampprojectbot

This comment has been minimized.

@dreamofabear dreamofabear changed the title amp-viewer-assistance extension <amp-viewer-assistance> extension Sep 15, 2018
@ampprojectbot

This comment has been minimized.

@ampprojectbot
Copy link
Member

This issue hasn't been updated in awhile. Do you have any updates?

hellokoji added a commit to hellokoji/amphtml that referenced this issue Feb 7, 2019
Change-Id: I637ace23a4ba415759a3103bc664d2316b75aa33
hellokoji added a commit to hellokoji/amphtml that referenced this issue Feb 7, 2019
Change-Id: I637ace23a4ba415759a3103bc664d2316b75aa33
hellokoji added a commit to hellokoji/amphtml that referenced this issue Feb 7, 2019
Change-Id: I78dac3ec9f85c3bbd1ceb4ce88a61b3f7d0dc539
hellokoji added a commit to hellokoji/amphtml that referenced this issue Feb 19, 2019
Change-Id: I78dac3ec9f85c3bbd1ceb4ce88a61b3f7d0dc539
dreamofabear pushed a commit that referenced this issue Feb 21, 2019
* Add amp-viewer-assistance extension (#15195).

Change-Id: I78dac3ec9f85c3bbd1ceb4ce88a61b3f7d0dc539

* Address PR comments 1.

Change-Id: I874c096e75e9428872b6609df4acb75a82ee5b09

* remove amp-viewer-integration styles

Change-Id: I6692ccec7eaccfce9227115c1ebca24b3a5fe118

* Fix javascript closure typing.

Change-Id: I3d282f2571cc48e388ddd222676a23ed0d61b67b

* Add copyright and license comments to amp-viewer-assistance files.

Change-Id: I5335d7d63843800a88319d760504fef7caab4d4f

* Remove newline.

Change-Id: If066222b53ed7912140c1e526e231aca43d9a38c

* Address PR comments 2.

Change-Id: I1c06c45a2159fcb5286db2a36e168907073a77fa

* Update amp-viewer-assistance documentation.

Change-Id: I9031cc6930c18de3ca691f41274f868670b72c7a

* Remove redundant amp-viewer-assistnace validator files.

Change-Id: I5c3194a511b64321500025e59375f618ed4660a4

* Remove amp-viewer-assistance-unstrusted experiement from experiments.js.

Change-Id: Ib20566f920d3c92da648d49dc7dd30fc78eb313f

* Address amp-viewer-assistance presubmit errors.

Change-Id: If962d4a174593b2eed997acfbc01844c0a3b0f72

* Lint.

Change-Id: Icaf921248e6f5f7f096c43cde4688d28f4943545

* Fix types.

Change-Id: I65dfc764cb7a1a226b6aac444392f5936b21478d

* Add expectAsyncConsoleError to catch error message in test.

Change-Id: I78849d7d82c98d3353b2a9ad5a1ed99d5c04e2d4
noranazmy pushed a commit to noranazmy/amphtml that referenced this issue Mar 22, 2019
* Add amp-viewer-assistance extension (ampproject#15195).

Change-Id: I78dac3ec9f85c3bbd1ceb4ce88a61b3f7d0dc539

* Address PR comments 1.

Change-Id: I874c096e75e9428872b6609df4acb75a82ee5b09

* remove amp-viewer-integration styles

Change-Id: I6692ccec7eaccfce9227115c1ebca24b3a5fe118

* Fix javascript closure typing.

Change-Id: I3d282f2571cc48e388ddd222676a23ed0d61b67b

* Add copyright and license comments to amp-viewer-assistance files.

Change-Id: I5335d7d63843800a88319d760504fef7caab4d4f

* Remove newline.

Change-Id: If066222b53ed7912140c1e526e231aca43d9a38c

* Address PR comments 2.

Change-Id: I1c06c45a2159fcb5286db2a36e168907073a77fa

* Update amp-viewer-assistance documentation.

Change-Id: I9031cc6930c18de3ca691f41274f868670b72c7a

* Remove redundant amp-viewer-assistnace validator files.

Change-Id: I5c3194a511b64321500025e59375f618ed4660a4

* Remove amp-viewer-assistance-unstrusted experiement from experiments.js.

Change-Id: Ib20566f920d3c92da648d49dc7dd30fc78eb313f

* Address amp-viewer-assistance presubmit errors.

Change-Id: If962d4a174593b2eed997acfbc01844c0a3b0f72

* Lint.

Change-Id: Icaf921248e6f5f7f096c43cde4688d28f4943545

* Fix types.

Change-Id: I65dfc764cb7a1a226b6aac444392f5936b21478d

* Add expectAsyncConsoleError to catch error message in test.

Change-Id: I78849d7d82c98d3353b2a9ad5a1ed99d5c04e2d4
bramanudom pushed a commit to bramanudom/amphtml that referenced this issue Mar 22, 2019
* Add amp-viewer-assistance extension (ampproject#15195).

Change-Id: I78dac3ec9f85c3bbd1ceb4ce88a61b3f7d0dc539

* Address PR comments 1.

Change-Id: I874c096e75e9428872b6609df4acb75a82ee5b09

* remove amp-viewer-integration styles

Change-Id: I6692ccec7eaccfce9227115c1ebca24b3a5fe118

* Fix javascript closure typing.

Change-Id: I3d282f2571cc48e388ddd222676a23ed0d61b67b

* Add copyright and license comments to amp-viewer-assistance files.

Change-Id: I5335d7d63843800a88319d760504fef7caab4d4f

* Remove newline.

Change-Id: If066222b53ed7912140c1e526e231aca43d9a38c

* Address PR comments 2.

Change-Id: I1c06c45a2159fcb5286db2a36e168907073a77fa

* Update amp-viewer-assistance documentation.

Change-Id: I9031cc6930c18de3ca691f41274f868670b72c7a

* Remove redundant amp-viewer-assistnace validator files.

Change-Id: I5c3194a511b64321500025e59375f618ed4660a4

* Remove amp-viewer-assistance-unstrusted experiement from experiments.js.

Change-Id: Ib20566f920d3c92da648d49dc7dd30fc78eb313f

* Address amp-viewer-assistance presubmit errors.

Change-Id: If962d4a174593b2eed997acfbc01844c0a3b0f72

* Lint.

Change-Id: Icaf921248e6f5f7f096c43cde4688d28f4943545

* Fix types.

Change-Id: I65dfc764cb7a1a226b6aac444392f5936b21478d

* Add expectAsyncConsoleError to catch error message in test.

Change-Id: I78849d7d82c98d3353b2a9ad5a1ed99d5c04e2d4
@stale
Copy link

stale bot commented Jul 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Inactive for one year or more label Jul 2, 2020
@dreamofabear
Copy link
Author

This extension was added in #20725.

@stale stale bot removed the Stale Inactive for one year or more label Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INTENT TO IMPLEMENT Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code P2: Soon Type: Feature Request WG: viewers
Projects
None yet
Development

No branches or pull requests

2 participants