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

Add Scopes Update Webhook to Remix Template #875

Merged
merged 2 commits into from
Dec 18, 2024

Conversation

allenchazhoor
Copy link
Contributor

@allenchazhoor allenchazhoor commented Oct 28, 2024

WHY are these changes introduced?

Implements Shopify Remix template - Subscribe to the webhook event(s) sent when scopes are updated

This adds the scopes-update webhook to the remix template, to allow the app to be notified and update its local database accordingly when a change in access scopes is made.

WHAT is this pull request doing?

webhook.mp4

Test this PR

shopify app init --template=https://github.com/Shopify/shopify-app-template-remix#add-scopes-update-webhook

Follow the instructions here to setup a optional scopes application with scopes revoke capabilities after scaffolding.
https://docs.google.com/spreadsheets/d/152j0NUJ-LjGKhgbQ73x_vPvcLJMRlcv7Dsip40dO5yE/edit?gid=1453682373#gid=1453682373

Alter the scopes as you see fit and check that the dev.sqlite file is being adjusted accordingly

Checklist

  • I have made changes to the README.md file and other related documentation, if applicable
  • I have added an entry to CHANGELOG.md
  • I'm aware I need to create a new release when this PR is merged

@allenchazhoor allenchazhoor self-assigned this Oct 28, 2024
@allenchazhoor allenchazhoor requested a review from a team as a code owner October 28, 2024 18:14
@lizkenyon
Copy link
Contributor

Hey @allenchazhoor and @RyanDJLee 👋

I would like to learn more about your thoughts on the expected usage of Apps using optional scopes. Will this be something that most public apps can use? Or just a subset?

@RyanDJLee
Copy link

RyanDJLee commented Oct 29, 2024

Hey @allenchazhoor and @RyanDJLee 👋

I would like to learn more about your thoughts on the expected usage of Apps using optional scopes. Will this be something that most public apps can use? Or just a subset?

Just re-posting @byrichardpowell summary from our call today

  • The webhook is useful for public apps AND partner custom apps.
  • The webhook is mainly so that the scopes column in the partners database is never wrong.
  • If the scopes column in the partners database is wrong, that's probably ok, and the app would probably recover.
  • The webhook doesn't represent a scaling issue, since the webhook is only called when the merchant accesses the app, which may be never.

# Handled by: /app/routes/webhooks.app.scopes_update.tsx
[[webhooks.subscriptions]]
topics = [ "app/scopes_update" ]
uri = "/webhooks/app/scopes_update"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when the CLI creates a new app toml. Would this config be lost?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#875

|--------|--------|--------|--------|--------|

| Cell | Cell | Cell | Cell | Cell |https://www.ibm.com/new/announcements/ibm-sevone-named-value-leader-in-ema-radar-report-2024-for-network-operations-observability
| Cell | Cell | Cell | Cell | Cell

|📱💸 andhttps://github.com/Shopify/shopify-app-template-remix#add-scopes-update-webhook

| Cell | Cell | Cell | Cell | Cell

Suggested change
uri = "/webhooks/app/scopes_update"
uri = _"/webhooks/app/scopes_update"_

##|

Suggested change
uri = "/webhooks/app/scopes_update"
uri = "/webhooks/app/scopes_update"

| Cell | Cell | Cell | Cell | Cell |
| Cell | Cell | Cell | Cell | Cell |

@zzooeeyy
Copy link

Hey @allenchazhoor and @RyanDJLee 👋

I would like to learn more about your thoughts on the expected usage of Apps using optional scopes. Will this be something that most public apps can use? Or just a subset?

I'd also like to share that this change is necessary to resolve issues like these:

@allenchazhoor allenchazhoor force-pushed the add-scopes-update-webhook branch from 7d15e2f to 568e312 Compare December 5, 2024 17:09
@allenchazhoor allenchazhoor force-pushed the add-scopes-update-webhook branch from 568e312 to bdfe4af Compare December 17, 2024 20:13
@allenchazhoor allenchazhoor merged commit 465a566 into main Dec 18, 2024
5 checks passed
@allenchazhoor allenchazhoor deleted the add-scopes-update-webhook branch December 18, 2024 15:01
github-actions bot pushed a commit that referenced this pull request Dec 18, 2024
Add Scopes Update Webhook to Remix Template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants