How to Customer session Token in theme app extensions

How to find Customer Session Token when we are using Theme app Extensions.

If we want to check whether the customer is logged in or not how?

Hey @Soumya_pittala, since theme app extensions use liquid, you can check this using the customer object

If our backend wants to validate the customer session on storefront how?

Hey @Soumya_pittala,

For backend validation from a Theme App Extension, the approach is to use an App Proxy. When you route requests through an App Proxy, Shopify automatically appends a logged_in_customer_id parameter to the forwarded request (populated if a customer is logged in, empty if not), along with a signature parameter that lets your backend verify the request genuinely came from Shopify.

The App Proxy authentication docs walk through the signature calculation with code examples.