Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Fix documentation on getOfflineId method #953

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/metal-needles-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
4 changes: 2 additions & 2 deletions docs/guides/webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ app.post('/webhooks', express.text({type: '*/*'}), async (req, res) => {

console.log(`Received webhook for ${topic} for shop ${domain}`);

const sessionId = shopify.session.getOfflineId({shop: domain});
const sessionId = shopify.session.getOfflineId(domain);

// Run your webhook-processing code here!
});
Expand All @@ -87,7 +87,7 @@ const handleWebhookRequest = async (
webhookId: string,
apiVersion: string,
) => {
const sessionId = shopify.session.getOfflineId({shop});
const sessionId = shopify.session.getOfflineId(shop);

// Run your webhook-processing code here!
};
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/session/getOfflineId.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You should **_never_** read the shop from user inputs or URLs.

```ts
async function myWebhookHandler(topic, shop) {
const offlineSessionId = await shopify.session.getOfflineId({shop});
const offlineSessionId = await shopify.session.getOfflineId(shop);

// use sessionId to retrieve session from app's session storage
// getSessionFromStorage() must be provided by application
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/webhooks/addHandlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const handleWebhookRequest = async (
webhookId: string,
apiVersion: string,
) => {
const sessionId = shopify.session.getOfflineId({shop});
const sessionId = shopify.session.getOfflineId(shop);

// Fetch the session from storage and process the webhook event
};
Expand Down