You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have a special case. My app works with queues where the workers are on other machines.
Now I have to init the workers with shopifyApi({appKey, appToken, .. }) to access the client.rest API. I saw you have @shopify/admin-api-client app but this doesn't have types .
What I like is to do something like this: const variant = new shopify.rest.Variant({session: session}); variant.product_id = 632910392; variant.option1 = "Yellow"; variant.price = "1.00"; await variant.save({ update: true, });
but not initializing the app with app credentials const shopify = shopifyApi({ // The next 4 values are typically read from environment variables for added security apiKey: 'APIKeyFromPartnersDashboard', apiSecretKey: 'APISecretFromPartnersDashboard', scopes: ['read_products'], hostName: 'ngrok-tunnel-address', ... });
Is there a workaround for my case?
The text was updated successfully, but these errors were encountered:
Could you provide me a bit more context on why you cannot initialize the shopifyAPI object? As well as confirm if you have a public or custom/private app? Could you also confirm if you are only using the Shopify API library or are you using the remix or express package as well. Could you also clarify how you are managing your sessions?
A common flow for applications that use deferred jobs, or workers. Is that they will use the offline access tokens for making their requests.
You will still need to create the shopifyAPI object, or app object if using some of our additional libraries, But instead of loading the session object by using your request object, you will use the helper method shopify.session.getOfflineId. Or if you are using the remix package we provide helper functions for getting the session and making API requests in these contexts.
We are closing this issue because we did not hear back regarding additional details we needed to resolve this issue. If the issue persists and you are able to provide the missing clarification we need, feel free to respond and reopen this issue.
We appreciate your understanding as we try to manage our number of open issues.
Hi,
I have a special case. My app works with queues where the workers are on other machines.
Now I have to init the workers with shopifyApi({appKey, appToken, .. }) to access the client.rest API. I saw you have @shopify/admin-api-client app but this doesn't have types .
What I like is to do something like this:
const variant = new shopify.rest.Variant({session: session}); variant.product_id = 632910392; variant.option1 = "Yellow"; variant.price = "1.00"; await variant.save({ update: true, });
but not initializing the app with app credentials
const shopify = shopifyApi({ // The next 4 values are typically read from environment variables for added security apiKey: 'APIKeyFromPartnersDashboard', apiSecretKey: 'APISecretFromPartnersDashboard', scopes: ['read_products'], hostName: 'ngrok-tunnel-address', ... });
Is there a workaround for my case?
The text was updated successfully, but these errors were encountered: