Comments (3)
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.
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.
How to get Permanent access token @paulomarg
from shopify-api-js.
Related Issues (20)
- Support pagination when searching customers with admin rest api HOT 1
- Unable to create customer with password using customerCreate on admin API node client HOT 1
- Expose RemixRestClient and GraphQLClient types for @shopify/shopify-app-remix HOT 1
- Managed Installation is broken when reinstalling from Admin's Settings. HOT 8
- GraphQL Codegen Fails with Multiple Errors When Generating Types for Shopify API HOT 4
- Upgrade to new Shopify API version without upgrading `@shopify/shopify-api` package HOT 1
- Documentation pages return 404 HOT 1
- A new release of the Shopify API is due soon HOT 1
- Keep getting INTERNAL_SERVER_ERROR on the response of `productVariantsBulkCreate` query HOT 1
- NEW BUG: storeAvailability locations missing HOT 2
- Customer deletion error: Disconnected before secure TLS was established HOT 1
- shopify.session.getCurrentId() fails to read request headers from Next.js app router HOT 6
- Multiple Webhook Handlers Error
- Rest resource `Shop.all()` returns the complete response HOT 3
- A new release of the Shopify API occurred
- April 2024 API version HOT 4
- Recurring Application Charge currency being returned as weird object with each letter as a different value HOT 1
- ShopifyApp::RequireKnownShop not worked for Shopify API version 2024-04 HOT 1
- `shop/update` webhook not triggered when editing `marketing_sms_consent_enabled_at_checkout` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shopify-api-js.