Skip to content

Commit

Permalink
docs: documented fetchCredentials options of JS SDK (#10510)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored Dec 10, 2024
1 parent 27a34a1 commit 9e3cca4
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions www/apps/resources/app/js-sdk/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,31 @@ The `Medusa` initializer accepts as a parameter an object with the following pro
<Table.Row>
<Table.Cell>

`auth.fetchCredentials`

</Table.Cell>
<Table.Cell>

By default, if `auth.type` is `session`, the `credentials: include` option is passed in [fetch requests](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#including_credentials) under the hood. However, some platforms or environments may not support passing this option.

This option accepts a string to configure the value of `credentials` when the authentication type is `session`. It accepts one of the following values:

- `include`: (default) to pass the `credentials: include` option.
- `omit`: to pass the `credentials: omit` option.
- `same-origin`: to pass the `credentials: same-origin` option.

This option is only available after [Medusa v2.1.1](https://github.com/medusajs/medusa/releases/tag/v2.1.1).

</Table.Cell>
<Table.Cell>

`local`

</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>

`globalHeaders`

</Table.Cell>
Expand Down

0 comments on commit 9e3cca4

Please sign in to comment.