Skip to content

Commit

Permalink
Updates example for GetAccessToken context
Browse files Browse the repository at this point in the history
GetAccessToken requires a context along with shopname and code
  • Loading branch information
ankit7 authored Sep 28, 2024
1 parent 462760c commit 2ebb2e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ func MyCallbackHandler(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
shopName := query.Get("shop")
code := query.Get("code")
token, err := app.GetAccessToken(shopName, code)
ctx := context.TODO() // adds context which will be used in GetAccessToken below
token, err := app.GetAccessToken(ctx, shopName, code)

// Do something with the token, like store it in a DB.
}
Expand Down

0 comments on commit 2ebb2e1

Please sign in to comment.