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

fix: support object based headers #852

Merged
merged 1 commit into from
Aug 27, 2024
Merged

Conversation

alvarosabu
Copy link
Contributor

@alvarosabu alvarosabu commented Aug 27, 2024

Fixes storyblok/storyblok-cli#107

Pull request type

Jira Link: INT-

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Other (please describe):

How to test this PR

  • Run the vanilla playground

What is the new behavior?

headers property now supports both object based headers or new Headers

const headers = new Headers()
headers.append('Awiwi', 'Awiwi')
const headers2 = {
  'Awiwi': 'Awiwi'
}
// Both should work
// 2. Initialize the client with the preview token
// from your space dashboard at https://app.storyblok.com
const Storyblok = new StoryblokClient({
  accessToken: import.meta.env.VITE_ACCESS_TOKEN as string,
  headers,
})

Other information

@alvarosabu alvarosabu added p5-urgent [Priority] Highest, Issues that disrupt core functionality and need immediate fixing. bugfix [PR] Fixes a bug labels Aug 27, 2024
@alvarosabu alvarosabu self-assigned this Aug 27, 2024
Copy link
Collaborator

@Edo-San Edo-San left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👌

@alvarosabu alvarosabu merged commit c1c4e72 into main Aug 27, 2024
2 of 3 checks passed
Copy link

🎉 This PR is included in version 6.9.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix [PR] Fixes a bug p5-urgent [Priority] Highest, Issues that disrupt core functionality and need immediate fixing. released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when running storyblok pull-components with valid SPACE_ID and token.
3 participants