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

feat(react-headless): expose token as client setting #465

Merged
merged 3 commits into from
Feb 14, 2025
Merged

Conversation

stigi
Copy link
Contributor

@stigi stigi commented Feb 13, 2025

The v1 user client supports token auth (code), but that was not available in react-headless (code).

This PR allows to pass the token through the MagicBellProvide to the UserClient where it was already accepted.

I've tested this in magicbell/mobile-inbox#21 where I used the preview package and can confirm that notifications load successfully when using a v2 JWT token.

Copy link

vercel bot commented Feb 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 14, 2025 1:10pm

@stigi stigi changed the title feat: expose token as client setting feat(react-headless): expose token as client setting Feb 13, 2025
Copy link

pkg-pr-new bot commented Feb 13, 2025

Open in Stackblitz

@magicbell/cli

npm i https://pkg.pr.new/@magicbell/cli@465

@magicbell/core

npm i https://pkg.pr.new/@magicbell/core@465

@magicbell/embeddable

npm i https://pkg.pr.new/@magicbell/embeddable@465

@magicbell/codegen

npm i https://pkg.pr.new/@magicbell/codegen@465

@magicbell/in-app

npm i https://pkg.pr.new/@magicbell/in-app@465

magicbell

npm i https://pkg.pr.new/magicbell@465

@magicbell/magicbell-react

npm i https://pkg.pr.new/@magicbell/magicbell-react@465

@magicbell/project-client

npm i https://pkg.pr.new/@magicbell/project-client@465

@magicbell/react-headless

npm i https://pkg.pr.new/@magicbell/react-headless@465

@magicbell/user-client

npm i https://pkg.pr.new/@magicbell/user-client@465

@magicbell/webpush

npm i https://pkg.pr.new/@magicbell/webpush@465

commit: 8daab31

@stigi stigi requested a review from smeijer February 13, 2025 16:42
@stigi stigi marked this pull request as ready for review February 13, 2025 16:42
@stigi
Copy link
Contributor Author

stigi commented Feb 14, 2025

Not sure why the tests failed, but #464 shows the same failure. I ran yarn test:ci locally where it passed. Rerunning the job on CI now.

@stigi stigi mentioned this pull request Feb 14, 2025
3 tasks
@stigi stigi enabled auto-merge (squash) February 14, 2025 13:11
@stigi stigi disabled auto-merge February 14, 2025 13:52
@stigi stigi merged commit 748822c into main Feb 14, 2025
6 of 7 checks passed
@stigi stigi deleted the headless-token branch February 14, 2025 13:52
@MagicBella MagicBella mentioned this pull request Feb 14, 2025
stigi pushed a commit that referenced this pull request Feb 14, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## [email protected]

### Minor Changes

- [#459](#459)
[`6688f1c`](6688f1c)
Thanks [@MagicBella](https://github.com/MagicBella)! - Automatic minor
version bump for changes in `magicbell`.

## @magicbell/[email protected]

### Minor Changes

- [#459](#459)
[`6688f1c`](6688f1c)
Thanks [@MagicBella](https://github.com/MagicBella)! - Automatic minor
version bump for changes in `@magicbell/project-client`.

## @magicbell/[email protected]

### Minor Changes

- [#465](#465)
[`748822c`](748822c)
Thanks [@stigi](https://github.com/stigi)! - Added `token` as a way to
authenticate the react-headless SDK. Also improved typings to make clear
which combination of parameters are expected

### Patch Changes

- Updated dependencies
\[[`6688f1c`](6688f1c)]:
    -   [email protected]

## @magicbell/[email protected]

### Minor Changes

- [#459](#459)
[`6688f1c`](6688f1c)
Thanks [@MagicBella](https://github.com/MagicBella)! - Automatic minor
version bump for changes in `@magicbell/user-client`.

## @magicbell/[email protected]

### Patch Changes

- Updated dependencies
\[[`6688f1c`](6688f1c)]:
    -   [email protected]

## @magicbell/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @magicbell/[email protected]

## @magicbell/[email protected]

### Patch Changes

- Updated dependencies
\[[`6688f1c`](6688f1c)]:
    -   @magicbell/[email protected]

## @magicbell/[email protected]

### Patch Changes

- Updated dependencies
\[[`748822c`](748822c)]:
    -   @magicbell/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants