How to set X-Shopify-Storefront-Access-Token header on Mobile Buy SDK, IOS

New Member
4 0 0

Hello. I am sure this has been solved before. However, I could not find the right answer. Your help will be greated appreciated.

I am trying to read products from ios to my "private" store for testing purpose. When a store is private, one could use X-Shopify-Storefront-Access-Token header. However, I could not find how to set the header in the ios code. Here is my code. Please help.


1. Create Client:

static let sharedClient = Graph.Client(
                                    shopDomain: "",
                                    apiKey:     "cd5b3b9ce48c5b88bb2777b0f57e4182"

 2. Query

        let query = Storefront.buildQuery { $0

            .products(first:100) {$0
                .edges {$0
                    .node {$0


        let task = client.queryGraphWith(query) { response, error in
            if ((response) != nil) {
                <process success>
            } else if (error != nil) {
                <process failure>
                print("Gosh! No")



Shopify Staff
Shopify Staff
535 105 105

Hi @_SC_ 


Can you attempt using the Storefront Access Token vs. the API key? 

Vix | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit or the Shopify Web Design and Development Blog