Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: documented fetchCredentials options of JS SDK #10510

Merged
merged 1 commit into from
Dec 10, 2024
Merged
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
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
Loading