Skip to content

Commit

Permalink
Updates example for GetAccessToken context (#310)
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 29, 2024
1 parent 462760c commit 6243e33
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 6243e33

Please sign in to comment.