gnikyt / laravel-shopify

A full-featured Laravel package for aiding in Shopify App development
MIT License
1.24k stars 374 forks source link

How to get session token when using laravel Vuejs embedded app(v17) #1014

Closed hamzasgd closed 2 years ago

hamzasgd commented 2 years ago

how to use tokenRoute when using Vuejs

sp-artisan commented 2 years ago

You can use app bridge which is NPM package. Its provided in shopify documentation here https://shopify.dev/apps/auth/session-tokens/app-bridge-utilities you can find it.

hamzasgd commented 2 years ago

I Figured out another solution for it.

tanseercena commented 2 years ago

I Figured out another solution for it.

@hamzasgd Can you list your solution here so it can help other developers?

I have same issue and need tokenRoute in vuejs component. Thanks

hamzasgd commented 2 years ago

@tanseercena Yes I added the class .session-token in the body tag and get the token from body when calling axios request

hamzasgd commented 2 years ago

@tanseercena by adding the class package automatically updating the token every minute so I just get from the body tag every time I make a axios request.