Giter VIP home page Giter VIP logo

Comments (3)

paulomarg avatar paulomarg commented on June 5, 2024

Hi, I believe the code you pasted is correct if you've created your app under your Partners account, but if you've created a custom app in your development store (which will give you a permanent token), you'll need to set a few of the fields for custom apps (as per the custom app docs):

// Configure the app as a custom app
const shopify = shopifyApi({
  // ...
  isCustomStoreApp: true,
  adminApiAccessToken: 'Permanent access token',
});

// Create a client
const client = new shopify.clients.Rest({
  session: shopify.session.customAppSession('<shop>.myshopify.com'),
});

The difference here is that custom apps and public apps use different headers, so the client needs to be set up differently. When using public apps, your app will need to go through OAuth to get access tokens for each store.

If you're just starting out, I'd also recommend creating an app with the Remix app template, using the CLI. It makes it quite a bit easier to manage access tokens.

Hope this helps!

from shopify-api-js.

github-actions avatar github-actions commented on June 5, 2024

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.

from shopify-api-js.

rajeevwebframez avatar rajeevwebframez commented on June 5, 2024

How to get Permanent access token @paulomarg

from shopify-api-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.